I have developed a small server that recives connections (using basically the example here: http://msdn.microsoft.com/en-us/library/system.net.sockets.tcplistener.aspx)
The problem is that i dont know how but whenever a connection is made, it cannot send data (or de data sent does not reach the server, the method Read of the NetworkStream from GetStream of the TcpListener just blocks and does not get any data byte.
I tried to just telnet it, instead of using the client i have and the problem is the same. The funny thing is that if i do “telnet localhost 2000” it works perfectly!!
It seems that something is blocking the communications (previously not even localhost was working until i upgraded .NET Fw on the server), but i dont know what can it be that just blocks the data but allows the connections, actually did not know than an application could do it!
Any help with this will be much appreciated!
Thank you!
EDIT:
The line
TcpClient client = server.AcceptTcpClient();
Gets the tcp connection properly then i get the networkstream and when i try to read from it, there is no data received (i == 0):
i = stream.Read(bytes, 0, bytes.Length)
It was a firewall… apparently there is some common service on port 2000 that has a specific protocol, and the firewall blocked all the data that was not following this protocol :/
Even though, thank you for your help!!