/// <summary> /// Create a new game client object with the target host and port. /// </summary> /// <param name="host">The target host.</param> /// <param name="port">The target port.</param> public GameClient(string host, int port = 80) { client = new NetworkClient(host, port); client.OnConnect +=new ConnectionStateChangeEventHandler(client_OnConnect); client.OnDisconnect += new ConnectionStateChangeEventHandler(client_OnDisconnect); client.OnReceive += new OnReceiveEventHandler(client_OnReceive); client.Connect(); }
public static void StartTest() { client = new NetworkClient("localhost", 81); client.Connect(); client.OnConnect += new ConnectionStateChangeEventHandler(client_OnConnect); client.OnDisconnect += new ConnectionStateChangeEventHandler(client_OnDisconnect); client.OnReceive += new OnReceiveEventHandler(client_OnReceive); }