Example #1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="ClientConnectedEventArgs" /> class.
        /// </summary>
        /// <param name="socket">The channel.</param>
        /// <param name="logger">Logger</param>
        /// <exception cref="ArgumentNullException">socket</exception>
        public SocketEventArgs(Socket socket, IPureLogger logger)
        {
            if (socket == null)
            {
                throw new ArgumentNullException("socket");
            }

            Channel       = new SocketChannel(logger);
            ChannelBuffer = new SocketBuffer();
            Channel.Assign(socket);
        }
Example #2
0
        /// <summary>
        /// Initializes a new instance of the <see cref="ClientConnectedEventArgs" /> class.
        /// </summary>
        /// <param name="socket">The channel.</param>
        /// <param name="logger">The logger.</param>
        /// <param name="messageBuffer">The message buffer.</param>
        /// <exception cref="ArgumentNullException">socket</exception>
        public ClientConnectedEventArgs(Socket socket, IPureLogger logger, int messageBuffer)
        {
            if (socket == null)
            {
                throw new ArgumentNullException(nameof(socket));
            }

            AllowConnect = true;

            Channel       = new SocketChannel(logger);
            ChannelBuffer = new SocketBuffer(messageBuffer);
            Channel.Assign(socket);
        }