コード例 #1
0
        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();
        }
コード例 #2
0
ファイル: CAcceptor.cs プロジェクト: channarit1994/Rebirth
        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();
        }