public NetServiceListClient(string hostIP, int hostPort) { mListServerConnection = new NetServiceConnection(hostIP, hostPort); mHostIP = hostIP; mListServerConnection.mReadDelegates += new NetServiceConnection.ReadDelegate(ReadData); mListServerConnection.mDisconnectedDelegates += new NetServiceConnection.DisconnectedDelegate(OnClientDisconnected); mListServerConnection.startRead(); mListServerConnection.write(WriteListCommand()); }
public void DebuggerDisconnect(int clientID) { if (mDebuggerClients.Count <= clientID) { return; } ////-- send disconnect packet to game. MemoryStream memStream = new MemoryStream(); DettachDebugger setBP = new DettachDebugger(memStream); NetServiceConnection client = mDebuggerClients[clientID]; client.write(memStream); ////-- reEnable the listbox. //sessionReset(); }
/////////////////////////////////////////////////// public void ConnectDebugger(int clientID) { if (mConnectedClients.Count <= clientID) { return; } NetServiceConnection client = mConnectedClients[clientID]; //-- tell game we want to attach. MemoryStream memStream = new MemoryStream(); // Determine the IPAddress of this machine string strHostName = ""; // NOTE: DNS lookups are nice and all but quite time consuming. strHostName = Dns.GetHostName(); IPHostEntry ipEntry = Dns.GetHostByName(strHostName); DebuggerAttach toGame = new DebuggerAttach(memStream, ipEntry.AddressList[0].ToString(), 1339, client.mClientName); client.write(memStream); }