public Varint32Frame copy() { Varint32Frame fd = new Varint32Frame(1); fd.end = end; if (payload != null) { fd.payload = payload.Copy(); } return fd; }
public Varint32Frame copy() { Varint32Frame fd = new Varint32Frame(1); fd.end = end; if (payload != null) { fd.payload = payload.Copy(); } return(fd); }
public override void OnOpen(USocket us) { Console.WriteLine ("连接建立"); AuthRequest request = new AuthRequest(); request.loginid = "lkjlkj;sdf你好"; request.serverid = 1; MemoryStream stream = new MemoryStream(); ProtoBuf.Serializer.Serialize<AuthRequest>(stream, request); Varint32Frame f = new Varint32Frame(512); f.PutShort(6); f.PutBytes(stream.ToArray()); f.End(); us.Send (f); }
public override void OnOpen(USocket us) { Console.WriteLine("连接建立"); AuthRequest request = new AuthRequest(); request.loginid = "lkjlkj;sdf你好"; request.serverid = 1; MemoryStream stream = new MemoryStream(); ProtoBuf.Serializer.Serialize <AuthRequest>(stream, request); Varint32Frame f = new Varint32Frame(512); f.PutShort(6); f.PutBytes(stream.ToArray()); f.End(); us.Send(f); }