TcpClient client = new TcpClient("69.147.112.160", 443);
SslStream sslStream = new SslStream(client.GetStream(),false,
ValidateServerCertificate,null);
try
{
sslStream.AuthenticateAsClient("mail.yahoo.com");
}
catch (AuthenticationException e)
{
return;
}
byte[] messsage = Encoding.UTF8.GetBytes(".<EOF>");
sslStream.Write(messsage);
sslStream.Flush();
byte[] buffer = new byte[4096];
int bytes2 = -1;
do
{
/**************************************************
*** JUST A LINE BELOW ALL buffer BYTES ARE ZERO!**
*************************************************/
bytes2 = sslStream.Read(buffer, 0, 4096);
m_sockClient.Send(buffer, bytes2, 0);
} while (bytes != 0);
TcpClient client = new TcpClient(69.147.112.160, 443); SslStream sslStream = new SslStream(client.GetStream(),false, ValidateServerCertificate,null); try {
Share
All bytes in
bufferthat have not been filled in by theReadcall will be zero; this is standard C#.If every last one byte in there is zero, only two things can be responsible:
Readdoes not read anything (in which case it returns0— you should definitely be checking the return value)