the server throws this error \"Attempting to deserialize an empty stream\" at server side in this line when I run the server: this.tcpListene
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...
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.
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.