Banshee.RemoteListener.RemoteListenerService.OnIncomingConnection C# (CSharp) Method

OnIncomingConnection() private method

Trigger on incomming client request.
private OnIncomingConnection ( IAsyncResult ar ) : void
ar IAsyncResult /// Contains the client socket. ///
return void
        void OnIncomingConnection(IAsyncResult ar)
        {
            Socket client = null;

            try {
                client = ((Socket)ar.AsyncState).EndAccept(ar);
                client.BeginReceive(Helper.Buffer, 0, Helper.Buffer.Length, SocketFlags.None,
                    OnReceiveRequest, client);
            } catch (Exception e) {
                if (!_disposed) {
                    Log.Error("error while handling client request by remote listener: " + e.Message);
                    _listener.BeginAccept(new AsyncCallback(OnIncomingConnection), _listener);
                }
            }
        }