예제 #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);
 }