示例#1
0
        public override bool SendMessage(IMessage message)
        {
            if (client.isConnected)
            {
                return(client.Send(MessageMgr.PackMessage(message, useBigEndian)));
            }

            return(false);
        }
示例#2
0
        private void onReceive(TcpClient client, byte[] bytes)
        {
            var message = MessageMgr.UnpackMessage(bytes, useBigEndian);

            if (message != null)
            {
                MessageMgr.DispatchMessage(message);
            }
        }
示例#3
0
        private void SendHeartbeat()
        {
            var message = MessageMgr.CreateMessage(hearbeatOpcode);

            if (message != null)
            {
                SendMessage(message);
            }
        }