Exemplo n.º 1
0
        public void StartServiceClient(string ip, int port)
        {
            NetworkMgr networkMgr = NetworkMgr.GetInst();

            networkMgr.mRecv += new EventHandler(OnRecvPacket);
            networkMgr.connectServer(ip, port);
            networkMgr.startAsync();
        }
Exemplo n.º 2
0
        public void StartServiceServer()
        {
            if (isRunServer)
            {
                return;
            }

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

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