public void StartServiceClient(string ip, int port) { NetworkMgr networkMgr = NetworkMgr.GetInst(); networkMgr.mRecv += new EventHandler(OnRecvPacket); networkMgr.connectServer(ip, port); networkMgr.startAsync(); }
public void StartServiceServer() { if (isRunServer) { return; } isRunServer = true; NetworkMgr networkMgr = NetworkMgr.GetInst(); networkMgr.mRecv += new EventHandler(OnRecvPacket); networkMgr.acceptAsync(); networkMgr.startAsync(); }
public void sendMsgToClient(int clientID, ICD.HEADER obj) { byte[] buf = obj.Serialize(); NetworkMgr.GetInst().WriteToClient(clientID, buf); }
public void sendMsgToServer(ICD.HEADER obj) { byte[] buf = obj.Serialize(); NetworkMgr.GetInst().WriteToClient(0, buf); }