Exemplo n.º 1
0
 public void Run()
 {
     Console.WriteLine("Running server...");
     _socket.Bind(new IPEndPoint(IPAddress.Any, 500));
     _socket.Listen(10);
     Console.WriteLine("Waiting for Client Connections");
 }
Exemplo n.º 2
0
        public void Run()
        {
            var hostIp   = (Dns.GetHostEntry(IPAddress.Any.ToString())).AddressList[0];
            var endpoint = new IPEndPoint(hostIp, 49389);

            _server.Bind(endpoint);
            _server.Listen(100);
        }
Exemplo n.º 3
0
 public void RunSocket(IPAddress ip, int port)
 {
     try
     {
         _socket.Bind(new IPEndPoint(ip, port));
         _socket.Listen(6);
     }
     catch (Exception e)
     {
         Console.WriteLine(e.ToString());
     }
 }
Exemplo n.º 4
0
 public void StartServer(IPAddress ipAddress)
 {
     try
     {
         IPEndPoint localEndPoint = new IPEndPoint(ipAddress, 8300);
         serverSocket.Bind(localEndPoint);
         serverSocket.Listen(10);
         Console.WriteLine("Waiting for clients to connect...");
         while (true)
         {
             ISocketProxy clientSocket = serverSocket.Accept();
             Individual   normalPerson = new NormalPerson(new Person(clientSocket));
             Thread       myThread     = new Thread(HandleLogin);
             myThread.Start(normalPerson);
         }
     }
     catch (Exception ex)
     {
         Console.WriteLine(ex);
     }
 }