예제 #1
0
        // Called when we receive a connection from a client
        public void OnConnection(IAsyncResult res)
        {
            Socket client = null;

            try
            {
                client = m_listener.EndAccept(res);
                _logger.Log("Policy server accepted connection.");
            }
            catch (SocketException)
            {
                return;
            }

            // handle this policy request with a PolicyConnection
            var pc = new PolicyConnection(client, m_policy, _logger);

            // look for more connections
            m_listener.BeginAccept(new AsyncCallback(OnConnection), null);
        }
예제 #2
0
        // Called when we receive a connection from a client
        public void OnConnection(IAsyncResult res)
        {
            Socket client = null;

            try
            {
                client = m_listener.EndAccept(res);
                _logger.Log("Policy server accepted connection.");
            }
            catch (SocketException)
            {
                return;
            }

            // handle this policy request with a PolicyConnection
            var pc = new PolicyConnection(client, m_policy, _logger);

            // look for more connections
            m_listener.BeginAccept(new AsyncCallback(OnConnection), null);
        }
예제 #3
0
파일: Program.cs 프로젝트: alanjg/MajorDomo
        // Called when we receive a connection from a client
        public void OnConnection(IAsyncResult res)
        {
            Console.WriteLine("Got connection");
            Socket client = null;

            try
            {
                client = m_listener.EndAccept(res);
            }
            catch (SocketException)
            {
                return;
            }

            // handle this policy request with a PolicyConnection
            PolicyConnection pc = new PolicyConnection(client, m_policy);

            // look for more connections
            m_listener.BeginAccept(new AsyncCallback(OnConnection), null);
        }