void KeepAlive(uint now) { m_sendCmdPkt.BeginWrite(); m_sendCmdPkt.WriteShort(SYS_PACKET_KEEP_ALIVE); m_sendCmdPkt.WriteUInt(now); SendPacket(m_sendCmdPkt, true, true); }
static void Main(string[] args) { TcpSession client = new TcpSession(); client.Connect("127.0.0.1", 8885); while (true) { string say = Console.ReadLine(); if (say.Length > 0) { CmdPacket packet = new CmdPacket(); packet.BeginWrite(); packet.WriteShort(22); packet.WriteString(say); client.SendPacket(packet); } } }