public CClientSocket(Socket socket) { m_socket = socket; Host = CSockHelp.SetSockOpt(ref m_socket); Disposed = false; m_recvBuffer = new byte[ReceiveSize]; m_buffer = new byte[ReceiveSize]; m_offset = 0; m_sendSync = new object(); }
public void StartListen(int backlog = 0) { ThrowIfDisposed(); if (m_active) { throw new InvalidOperationException(); } m_sock = CSockHelp.CreateTcpSock(); m_sock.Bind(new IPEndPoint(m_address, m_port)); m_sock.Listen(backlog); m_active = true; BeginAccept(); }