コード例 #1
0
ファイル: GameClient.cs プロジェクト: DisruptionTheory/WebDE
 /// <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();
 }
コード例 #2
0
ファイル: test.cs プロジェクト: DisruptionTheory/WebDE
 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);
 }