示例#1
0
 /// <summary>
 ///     Initializes a new instance of the <see cref="ServerClientStateObject" /> class.
 /// </summary>
 public ServerClientStateObject(byte[]              bufferRead,
                                CircularBuffer circularBuffer,
                                BigDataHandler <int> bigDataHandler)
 {
     BufferRead     = bufferRead;
     CircularBuffer = circularBuffer;
     BigDataHandler = bigDataHandler;
 }
示例#2
0
        /// <summary>
        ///     Initializes a new instance of the <see cref="UdpServerEapBase{TServerClient}" /> class.
        /// </summary>
        /// <param name="expectedMaxPayloadSize"> (Optional) Size of the expected maximum payload. </param>
        private protected UdpClientBase(ushort expectedMaxPayloadSize = Constants.UDP_PAYLOAD_SIZE_MAX)
            : base(4)
        {
            _maxPayloadSize =
                expectedMaxPayloadSize > 0 && expectedMaxPayloadSize < Constants.UDP_PAYLOAD_SIZE_MAX
                    ? expectedMaxPayloadSize
                    : Constants.TCP_PAYLOAD_SIZE_MAX;

            _bigDataHandler = new BigDataHandler <int> .Timed();
        }
示例#3
0
        /// <summary>
        ///     Initializes a new instance of the <see cref="TcpServerBase{TServerClient}" /> class.
        /// </summary>
        /// <param name="expectedMaxPayloadSize"> (Optional) Size of the expected maximum payload. </param>
        private protected TcpClientBase(ushort expectedMaxPayloadSize = Constants.TCP_PAYLOAD_SIZE_MAX)
        {
            _maxPayloadSize = expectedMaxPayloadSize > 0 && expectedMaxPayloadSize < Constants.TCP_PAYLOAD_SIZE_MAX
                ? expectedMaxPayloadSize
                : Constants.TCP_PAYLOAD_SIZE_MAX;
            _payloadSize = (ushort)(PayloadEncoding.EncodedPayloadLength(_maxPayloadSize) + 1);

            _bufferRead     = new byte[_payloadSize + Constants.TCP_HEADER_OFFSET];
            _circularBuffer = new CircularBuffer(_bufferRead.Length * 2);
            _bigDataHandler = new BigDataHandler <int> .Default();
        }