I wonder if MemoryStream.WriteTo is an asynchronous method ?
i am using it like this in my asynchronous Socket Server
public void Send(byte[] buffer)
{
if (buffer == null)
return;
using (var s = new MemoryStream(buffer))
{
if (SslStream != null) s.WriteTo(SslStream);
}
}