I found one interesting bug with the NetworkStream object. When the server disconnects from your connection, I would expect that the underlying socket would raise an error. It does not. What happens is that the asynchronous call back goes into a tight loop and uses up all of the processor time. Check the byte count to trap this problem. If the number of bytes read from the socket is zero, then close your TCP connection. I have tried using the State object to check for socket problems, but it does not appear to be implemented as of yet. The TCPClient object does not have public properties or methods to determine the connection state either.
Сейчас этот форум просматривают: нет зарегистрированных пользователей и гости: 1