Can't connect to my IP using Socket

后端 未结 3 1245
生来不讨喜
生来不讨喜 2020-12-21 06:48

the server throws this error \"Attempting to deserialize an empty stream\" at server side in this line when I run the server: this.tcpListene

相关标签:
3条回答
  • 2020-12-21 07:05

    I've same problem and I'm also behind router and firewall. I found that with your code localhost (127.0.0.1) works perfect but as soon as we try to connect to remote host it gives an error. Solution is change your server side code as follows:

    tcpListener = new TcpListener(IPAddress.Any, 8001);
    

    Hope this will help you...

    0 讨论(0)
  • 2020-12-21 07:13

    When you start your application and are listening on a port, run a port forward check here.

    I've had this problem when writing network software - it's a common problem.

    Once you've verified that its a port forwarding problem, head over to PortForward.com. There are great resources there to help you configure your router.

    0 讨论(0)
  • 2020-12-21 07:27

    The firewall and/or router/switch you are obviously behind is the cause. It would require a change or an addition of a NAT policy on said appliance.

    0 讨论(0)
提交回复
热议问题