Exemplo n.º 1
0
        public void Start(string host, int port)
        {
            this.host = host;
            this.port = port;

            ipAddress = Dns.GetHostAddresses(host)[0];

            listener = new TcpListener(ipAddress, port);
            listener.Start();
            serverForm.SetMessage("Listening on port: " + port + "...");

            thread = new Thread(new ThreadStart(ServerStartThread));
            thread.IsBackground = true;
            thread.Priority     = ThreadPriority.Highest;
            thread.Name         = "ServerStartThread";
            thread.Start();
        }
Exemplo n.º 2
0
        public void Start(string host, int port)
        {
            this.host = host;
            this.port = port;

            ipAddress = Dns.GetHostAddresses(host)[0];

            listener = new TcpListener(ipAddress, port);
            listener.Start();
            serverForm.SetMessage("Servidor iniciado y escuchando en puerto: " + port);

            thread = new Thread(new ThreadStart(ServerStartThread));
            thread.IsBackground = true;
            thread.Priority     = ThreadPriority.Highest;
            thread.Start();
        }