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