SslStream.ReadByte() blocks thread?
- by alex
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");