Client chat Can not read data from the transport connection:

1

Hello everyone it's the following I did a server tc pque already concludes, in the last days I have been doing the client but it is giving the following error

  

Can not read data from the transport connection: One   the lock operation was interrupted by a call to   WSACancelBlockingCall.

The error is giving in this part of the code

     private void ReceiveMessages()
            {
                srReceiver = new StreamReader(tcpServer.GetStream());
                string ConResponse = srReceiver.ReadLine();
                if (ConResponse[0] == '1')
                {
                    this.Invoke(new UpdateLogCallback(this.UpdateLog), new object[] { "Conected!" });
                }
                else
                {
                    string Reason = "Nao conectado: ";
                    Reason += ConResponse.Substring(2, ConResponse.Length - 2);
                    this.Invoke(new CloseConnectionCallback(this.CloseConnection), new object[] { Reason });

    return;
                }
                while (Connected)
                {

                    try
                    {

                        this.Invoke(new UpdateLogCallback(this.UpdateLog), new object[] { srReceiver.ReadLine() });
                    }
                    catch
                    { }
                }
            }

Update1 just to let you know that I'm connecting to ip 127.0.0.1 with port 1177

    
asked by anonymous 12.08.2016 / 12:00

0 answers