48 #endif |
47 #endif |
49 |
48 |
50 // |
49 // |
51 // Constants affecting protocol performance |
50 // Constants affecting protocol performance |
52 // |
51 // |
53 const TUint KOneSecondInUs = 1000000; //< For sec <-> usec conversions |
52 const TUint KOneSecondUs = 1000000; //< Help for converting longer times to microseconds |
54 const TUint KOneSecondInMs = 1000; //< For sec <-> msec conversions |
|
55 const TUint KOneMsInUs = 1000; //< For msec <-> usec conversions |
|
56 |
53 |
57 const TUint KTcpMaximumWindow = 0x3fffffff; //< Maximum receive window size |
54 const TUint KTcpMaximumWindow = 0x3fffffff; //< Maximum receive window size |
58 const TUint KTcpMinimumWindow = 1024; //< Minimum receive window size |
55 const TUint KTcpMinimumWindow = 1024; //< Minimum receive window size |
59 const TUint KTcpDefaultRcvWnd = 48 * 1024; //< Default receive window size |
56 const TUint KTcpDefaultRcvWnd = 48 * 1024; //< Default receive window size |
60 const TUint KTcpDefaultSndWnd = 16 * 1024; //< Default send window size |
57 const TUint KTcpDefaultSndWnd = 16 * 1024; //< Default send window size |
61 |
58 |
62 const TUint KTcpDefaultMSS = 65535; //< By default, MSS is not limited by user |
59 const TUint KTcpDefaultMSS = 65535; //< By default, MSS is not limited by user |
63 const TUint KTcpStandardMSS = 536; //< Internet standard MSS |
60 const TUint KTcpStandardMSS = 536; //< Internet standard MSS |
64 const TUint KTcpMinimumMSS = 64; //< Minimum acceptable MSS. |
61 const TUint KTcpMinimumMSS = 64; //< Minimum acceptable MSS. |
65 const TUint KTcpMaxTransmit = 1; //< Transmit at most this many segments at one time. |
62 const TUint KTcpMaxTransmit = 2; //< Transmit at most this many segments at one time. |
66 |
63 |
67 const TUint KTcpMinRTO = 1000000; //< us (1s) |
64 const TUint KTcpMinRTO = 1000000; //< us (1s) |
68 const TUint KTcpMaxRTO = 60000000; //< us (60s) |
65 const TUint KTcpMaxRTO = 60000000; //< us (60s) |
69 const TUint KTcpInitialRTO = 3000000; //< us (3s) |
66 const TUint KTcpInitialRTO = 3000000; //< us (3s) |
70 const TUint KTcpSrttSmooth = 8; //< alpha = 1/8 |
67 const TUint KTcpSrttSmooth = 8; //< alpha = 1/8 |
515 TUint32 iFRTOsent; //< True, if rto was sent and no acks have yet arrived |
512 TUint32 iFRTOsent; //< True, if rto was sent and no acks have yet arrived |
516 TTcpSeqNum iRealSendHigh; //< iSendHigh is not real with SACK |
513 TTcpSeqNum iRealSendHigh; //< iSendHigh is not real with SACK |
517 |
514 |
518 // -1=linger disabled, >=0 linger enabled with given time in seconds. |
515 // -1=linger disabled, >=0 linger enabled with given time in seconds. |
519 TInt iLinger; |
516 TInt iLinger; |
520 |
|
521 //Introduce specifically for Browser usecase where in Normal shutdown is expected to close with in certain time. |
|
522 //current structure is using secs. This Bit will enable calculation in Mircosecs. |
|
523 TBool iMicroSecCalcFlag; |
|
524 |
517 |
525 // Window scaling factor for the send window, advertised by the other end. |
518 // Window scaling factor for the send window, advertised by the other end. |
526 TUint8 iSndWscale:4; |
519 TUint8 iSndWscale:4; |
527 |
520 |
528 // Window scaling factor for receive window, based on ini settings. |
521 // Window scaling factor for receive window, based on ini settings. |
787 iDelayAckTimer->Cancel(); |
780 iDelayAckTimer->Cancel(); |
788 } |
781 } |
789 |
782 |
790 inline TUint32 CProviderTCP6::TimeStamp() |
783 inline TUint32 CProviderTCP6::TimeStamp() |
791 { |
784 { |
792 TInt tickPeriod; |
785 TTime now; |
793 TUint64 ticsInMs; |
|
794 // |
|
795 HAL::Get( HAL::ENanoTickPeriod, tickPeriod ); |
|
796 ticsInMs = (static_cast<TUint64> ( User::NTickCount() ) * tickPeriod) |
|
797 / KOneMsInUs; |
|
798 return static_cast<TUint32> ( ticsInMs ); |
|
799 /* |
|
800 // This used to return micro seconds, but since the resolution of NTick |
|
801 // is something around ~1ms, we return now the timestamp in milliseconds |
|
802 // (which is more than sufficient resolution for this). This is done to |
|
803 // mittigate the risk of counter overflow. |
|
804 // The existing implementation is commented and not removed for future reference |
|
805 // if required. |
|
806 TTime now; |
|
807 now.UniversalTime(); |
786 now.UniversalTime(); |
808 #ifdef I64LOW |
787 #ifdef I64LOW |
809 return I64LOW(now.Int64()); |
788 return I64LOW(now.Int64()); |
810 #else |
789 #else |
811 return (TUint32)now.Int64().GetTInt(); |
790 return (TUint32)now.Int64().GetTInt(); |
812 #endif |
791 #endif |
813 */ |
|
814 } |
792 } |
815 |
793 |
816 /** |
794 /** |
817 * Return maximum segment size allowed by transmission path. Following tradition, |
795 * Return maximum segment size allowed by transmission path. Following tradition, |
818 * the value represents the maximum number of data bytes that can be passed in |
796 * the value represents the maximum number of data bytes that can be passed in |