When I read an a .Net SSLStream, I can't seem to read it all in one go. The read method always gets the first byte only. I need to loop to get the remaining data no matter the data or buffer size.
Example :
Client
var message = new byte[]{1,2,3,4,5};
sslStream.Write(messsage);
sslStream.Flush();
Server
byte[] buffer = new byte[4000];
bytes = sslStream.Read(buffer, 0, buffer.Length);
Am I doing something wrong ? Why is it reading only one byte on the first read ?