示例#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));
        }
示例#2
0
 public virtual void Awake()
 {
     instance = this;
 }
示例#3
0
 private bool SendEmptyMessageImpl(int id)
 {
     AbstractSocket.CopyBytes(0, outbuffer, 0);
     AbstractSocket.CopyBytes((UInt16)id, outbuffer, 2);
     return(Send(outbuffer, 0, 4));
 }