Ejemplo n.º 1
0
 public static void SetupServer()
 {
     for (int i = 0; i < Constants.MAX_CONNECTIONS; i++)
     {
         Clients[i] = new Client();
     }
     ServerSocket.Bind(new IPEndPoint(IPAddress.Any, 8081));
     ServerSocket.Listen(10);
     ServerSocket.BeginAccept(new AsyncCallback(AcceptCallback), null);
     NetworkDataHandler.InitializeNetworkPackages(true);
     NetworkDataHandler.SelectionReceived += NetworkDataHandler_SelectionReceived;
 }
Ejemplo n.º 2
0
 public static void ConnectToServer()
 {
     Console.WriteLine("Connecting to server...");
     NetworkDataHandler.InitializeNetworkPackages();
     ClientSocket.BeginConnect("192.168.1.101", 8081, new AsyncCallback(ConnectCallback), ClientSocket);
 }