/// <summary> /// Creates a new instance of this class /// </summary> /// <param name="iSourcePort">The source (remote) port to bind this socket to</param> /// <param name="iDestinationPort">The destination (local) port to bind this socket to</param> /// <param name="bPseudoHeader">The layer 3 pseudeo header to calculate the checksum with</param> public TCPListenerSocket(int iSourcePort, int iDestinationPort, IPseudoHeaderSource pseudoHaaderSource) { oTCBLock = new object(); RemoteBinding = iSourcePort; LocalBinding = iDestinationPort; this.pseudoHeaderSource = pseudoHaaderSource; TCPState = TCPSocketState.Closed; tcpFrameStore = new List <TCPFrame>(); CreateTCB(); }
/// <summary> /// Creates a new instance of this class /// </summary> /// <param name="iSourcePort">The source (remote) port to bind this socket to</param> /// <param name="iDestinationPort">The destination (local) port to bind this socket to</param> /// <param name="bPseudoHeader">The layer 3 pseudeo header to calculate the checksum with</param> public TCPSocket(int iSourcePort, int iDestinationPort, IPseudoHeaderSource pseudoHaaderSource) { areClosed = new AutoResetEvent(false); areConnected = new AutoResetEvent(false); bFlushWhenEstablished = false; oTCBLock = new object(); tTimeWaitTimer = new Timer(new TimerCallback(HandleTimeWaitElapsed), null, Timeout.Infinite, Timeout.Infinite); RemoteBinding = iSourcePort; LocalBinding = iDestinationPort; this.pseudoHeaderSource = pseudoHaaderSource; rbSendBuffer = new RingBuffer(65565); r = new Random(); lastTcpState = TCPSocketState.Closed; tcpState = TCPSocketState.Closed; MaximumSegmentSize = 1400; tcpFrameStore = new List <TCPFrame>(); tcpRetransmissionQueue = new TCPRetransmissionQueue(Transmit, HandleTransmissionFailure); }