SslStream.ReadByte() blocks thread?

Posted by alex on Stack Overflow See other posts from Stack Overflow or by alex
Published on 2010-06-13T13:42:11Z Indexed on 2010/06/13 14:02 UTC
Read the original article Hit count: 227

Filed under:
|
|

I'm trying to write an Imap4 client.
For that I use a SslStream to Connect to the Server.
Everything's fine until I send the "Login" command.
When I try to get an Answer to it, SslStream.ReadByte() block the thread.
The result is that my programm crashes always.
Whats happening here??

Code:

 if (ssl)
{
     s = stream;
}

int cc = 0; MessageBox.Show("entered"); while (true) { int xs = s.ReadByte(); MessageBox.Show(xs.ToString()); if (xs > 0) { buf.Add((byte)xs); cc++; if (xs == '\n') { break; } if (cc > 10) MessageBox.Show(en.GetString(buf.ToArray())); } else { break; } } MessageBox.Show("left");

© Stack Overflow or respective owner

Related posts about c#

Related posts about networking