예제 #1
0
        private static void WelcomeConnection()
        {
            ipEndPoint  = new IPEndPoint(IPAddress.Any, PORT);
            tcpListener = new TcpListener(ipEndPoint);

            tcpListener.Start();

            serverRunning = true;
            while (serverRunning)
            {
                Debug.Log("Ready");
                try {
                    Socket welcomeSocket = tcpListener.AcceptSocket();
                    if (ClientManager.AddClient(welcomeSocket))
                    {
                        Debug.Log("connected");
                    }
                    else
                    {
                        Debug.Log("false");
                    }
                }
                catch (Exception e) {
                    Debug.Log(e.Message);
                    break;
                }
            }

            Debug.Log("Welcome Dead");
        }
예제 #2
0
        private static void WelcomeConnection()
        {
            ipEndPoint  = new IPEndPoint(IPAddress.Any, PORT);
            tcpListener = new TcpListener(ipEndPoint);

            tcpListener.Start();

            serverRunning = true;
            while (serverRunning)
            {
                try {
                    Socket welcomeSocket = tcpListener.AcceptSocket();
                    ClientManager.AddClient(welcomeSocket);
                } catch (Exception e) {
                    Debug.Log(e.ToString());
                    break;
                }
            }

            Debug.Log("Welcome Dead");
        }
예제 #3
0
        private static void WelcomeConnection()
        {
            ipEndPoint  = new IPEndPoint(IPAddress.Any, PORT);
            tcpListener = new TcpListener(ipEndPoint);

            tcpListener.Start();

            ConsoleMsgQueue.EnqueMsg("Waiting for Clients...");
            serverRunning = true;
            while (serverRunning)
            {
                try {
                    Socket welcomeSocket = tcpListener.AcceptSocket();
                    ClientManager.AddClient(welcomeSocket);
                } catch (Exception e) {
                    ConsoleMsgQueue.EnqueMsg("WELCOME CONNECTION: " + e.Message);
                    break;
                }
            }

            ConsoleMsgQueue.EnqueMsg("Welcome Thread Dead.");
        }