Beispiel #1
0
        private bool SendProtoMessageImpl(int id, Stream stream)
        {
            stream.Seek(0, SeekOrigin.Begin);
            int len = stream.Read(outbuffer, 4, (int)stream.Length);

            AbstractSocket.CopyBytes((UInt16)len, outbuffer, 0);
            AbstractSocket.CopyBytes((UInt16)id, outbuffer, 2);
            return(Send(outbuffer, 0, (int)len + 4));
        }
Beispiel #2
0
 private bool SendEmptyMessageImpl(int id)
 {
     AbstractSocket.CopyBytes(0, outbuffer, 0);
     AbstractSocket.CopyBytes((UInt16)id, outbuffer, 2);
     return(Send(outbuffer, 0, 4));
 }