public void InCompleted(SocketError socketError, int bytesTransferred) { if (socketError != SocketError.Success) { m_socket.EventAcceptFailed(m_address.ToString(), ErrorHelper.SocketErrorToErrorCode(socketError)); // dispose old object m_acceptedSocket.Handle.Dispose(); Accept(); } else { m_acceptedSocket.InitOptions(); PgmSession pgmSession = new PgmSession(m_acceptedSocket, m_options); IOThread ioThread = ChooseIOThread(m_options.Affinity); SessionBase session = SessionBase.Create(ioThread, false, m_socket, m_options, new Address(m_handle.LocalEndPoint)); session.IncSeqnum(); LaunchChild(session); SendAttach(session, pgmSession, false); m_socket.EventAccepted(m_address.ToString(), m_acceptedSocket.Handle); Accept(); } }
public void InCompleted(SocketError socketError, int bytesTransferred) { if (socketError != SocketError.Success) { m_socket.EventAcceptFailed(m_address.ToString(), ErrorHelper.SocketErrorToErrorCode(socketError)); // dispose old object m_acceptedSocket.Handle.Dispose(); Accept(); } else { m_acceptedSocket.InitOptions(); var pgmSession = new PgmSession(m_acceptedSocket, m_options); IOThread ioThread = ChooseIOThread(m_options.Affinity); SessionBase session = SessionBase.Create(ioThread, false, m_socket, m_options, new Address(m_handle.LocalEndPoint)); session.IncSeqnum(); LaunchChild(session); SendAttach(session, pgmSession, false); m_socket.EventAccepted(m_address.ToString(), m_acceptedSocket.Handle); Accept(); } }