Пример #1
0
        public void StartServiceClient(string ip, int port)
        {
            NetworkMgr networkMgr = NetworkMgr.GetInst();

            networkMgr.mRecv += new EventHandler(OnRecvPacket);
            networkMgr.connectServer(ip, port);
            networkMgr.startAsync();
        }
Пример #2
0
        public void StartServiceServer()
        {
            if (isRunServer)
            {
                return;
            }

            isRunServer = true;
            NetworkMgr networkMgr = NetworkMgr.GetInst();

            networkMgr.mRecv += new EventHandler(OnRecvPacket);
            networkMgr.acceptAsync();
            networkMgr.startAsync();
        }
Пример #3
0
 public void sendMsgToClient(int clientID, ICD.HEADER obj)
 {
     byte[] buf = obj.Serialize();
     NetworkMgr.GetInst().WriteToClient(clientID, buf);
 }
Пример #4
0
 public void sendMsgToServer(ICD.HEADER obj)
 {
     byte[] buf = obj.Serialize();
     NetworkMgr.GetInst().WriteToClient(0, buf);
 }