コード例 #1
0
 internal SocketBuffer(byte[] buffer, IBufferListener bufferListener, SocketAsyncEventArgs socketArgs)
 {
     _mutex          = new object();
     _bufferListener = bufferListener;
     Buffer          = buffer;
     SocketEventArgs = socketArgs;
 }
コード例 #2
0
        internal SocketBuffer CreateSocketBuffer(IBufferListener bufferListener)
        {
            var buffer    = new byte[_bufferSize];
            var eventArgs = new SocketAsyncEventArgs();

            eventArgs.RemoteEndPoint = _clientManger.ClientSocket.RemoteEndPoint;
            eventArgs.Completed     += _clientManger.ConnectionManager.OnReceiveBuffer;
            eventArgs.SetBuffer(buffer, 0, 0);
            return(new SocketBuffer(buffer, bufferListener, eventArgs));
        }