Connecting to a remote machine through client-server

I have created a simple tcp client-server application in Everything works fine when i set *local host* ( as the ip address. I wish to make a connection to a remote machine (keeping client at my machine and server on the other - or vice versa). EDIT: ok, the code of interest is as follows: the server: Dim server As TcpListener = New TcpListener(IPAddress.Any, port) the client: Dim theip As IPAddress = IPAddress.Parse(TextBox1.Text) client = New TcpClient(theip.ToString, port) Now, what should i enter in "TextBox1.Text" if i have my client on a remote machine (connected over internet) and server at a different computer (whose external IP address is known)? Can i enter the external IP address of the machine running the server directly in the text box? Also, do i need to take care of things like "port forwarding" / "let firewall allow the connection" and all? If yes, can you please guide me or link a tutorial so that my application does this automatically or is there an alternative approach to achieve this and so that port forward is not required? Thanks a lot!
If you're connecting over internet, port forwarding IS a must, like for all network connections, so the appropriate machine responds to the appropriate port. When connecting on a LAN, you just need to allow outgoing on the client and incoming connections on the server on the firewall. There is no way your program can setup those, it's completely outside of your app responsibilities to do so. You should put clear documentation or guidelines for the user to perform those steps on both PCs. A "test connection" button may help for troubleshooting.

以上就是Connecting to a remote machine through client-server的详细内容,更多请关注web前端其它相关文章!

赞(0) 打赏
未经允许不得转载:web前端首页 » JavaScript 答疑

评论 抢沙发

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址

前端开发相关广告投放 更专业 更精准