private void ReplyHeartbeat(string sessionID, int number) { HeartbeatReply msg = new HeartbeatReply(); msg.number = number; m_server.Send(sessionID, msg.Serialize()); }
public static HeartbeatReply Parse(byte[] data) { var num = BitConverter.ToInt32(data, 0); HeartbeatReply msg = new HeartbeatReply(); msg.number = num; return(msg); }
public static HeartbeatReply Deserialze(byte[] data) { byte[] body = new byte[data.Length - 2]; Array.Copy(data, 2, body, 0, data.Length - 2); HeartbeatReply msg = HeartbeatReply.Parse(body); return(msg); }