networkprotocols/tcpipv4v6prt/inc/tcp.h
branchRCL_3
changeset 14 23b59305592d
parent 8 e9cc36e353d4
child 17 d566d76acea1
--- a/networkprotocols/tcpipv4v6prt/inc/tcp.h	Tue May 11 17:38:48 2010 +0300
+++ b/networkprotocols/tcpipv4v6prt/inc/tcp.h	Tue May 25 14:22:18 2010 +0300
@@ -32,6 +32,7 @@
 #include "frag.h"
 #include "inet6log.h"
 #include <in6_opt.h>
+#include <hal.h>
 
 #ifdef SYMBIAN_ADAPTIVE_TCP_RECEIVE_WINDOW
 #include <in_sock.h>
@@ -49,7 +50,9 @@
 //
 // Constants affecting protocol performance
 //
-const TUint KOneSecondUs      = 1000000;    //< Help for converting longer times to microseconds
+const TUint KOneSecondInUs      = 1000000;   //< For sec <-> usec conversions
+const TUint KOneSecondInMs      = 1000;      //< For sec <-> msec conversions
+const TUint KOneMsInUs          = 1000;      //< For msec <-> usec conversions
 
 const TUint KTcpMaximumWindow = 0x3fffffff;  //< Maximum receive window size
 const TUint KTcpMinimumWindow =      1024;  //< Minimum receive window size
@@ -59,7 +62,7 @@
 const TUint KTcpDefaultMSS    =     65535;  //< By default, MSS is not limited by user
 const TUint KTcpStandardMSS   =       536;  //< Internet standard MSS
 const TUint KTcpMinimumMSS    =        64;  //< Minimum acceptable MSS.
-const TUint KTcpMaxTransmit   =         2;  //< Transmit at most this many segments at one time.
+const TUint KTcpMaxTransmit   =         1;  //< Transmit at most this many segments at one time.
 
 const TUint KTcpMinRTO        =   1000000;  //< us (1s)
 const TUint KTcpMaxRTO        =  60000000;  //< us (60s)
@@ -236,6 +239,7 @@
 	void SetRecvWin(TUint aRecvWin) { iRecvBuf = aRecvWin;}
 	TUint GetRecvWinSize()			{ return iRecvBuf;	 }
 	TUint RecvMaxWnd()              { return iTcpMaxRecvWin;}
+	TUint RecvBufFromIniFile()      { return iRecvBufFromIniFile; }
 #endif //SYMBIAN_ADAPTIVE_TCP_RECEIVE_WINDOW
 
 #ifdef _LOG
@@ -295,6 +299,7 @@
 	RMBufAllocator iBufAllocator;
 #ifdef SYMBIAN_ADAPTIVE_TCP_RECEIVE_WINDOW
 	TUint iTcpMaxRecvWin;
+	TUint iRecvBufFromIniFile;
 #endif //SYMBIAN_ADAPTIVE_TCP_RECEIVE_WINDOW
 	};
 
@@ -442,6 +447,8 @@
 	TUint32 iShrinkedWindowSize;
 	// Window size set by user. This will override the default values for the bearers
 	TBool   iWindowSetByUser;
+	//Flag for socket startup case. No tcp window expand/shrink in this case.
+	TBool iSocketStartupCase;
 #endif //SYMBIAN_ADAPTIVE_TCP_RECEIVE_WINDOW
 
 	// Maximum Segment Sizes
@@ -778,13 +785,28 @@
 
 inline TUint32 CProviderTCP6::TimeStamp()
 	{
-	TTime now;
+    TInt tickPeriod;
+    TUint64 ticsInMs;
+    // 
+    HAL::Get( HAL::ENanoTickPeriod, tickPeriod );
+    ticsInMs = (static_cast<TUint64> ( User::NTickCount() ) * tickPeriod)
+        / KOneMsInUs;
+    return static_cast<TUint32> ( ticsInMs );
+    /*
+    // This used to return micro seconds, but since the resolution of NTick
+    // is something around  ~1ms, we return now the timestamp in milliseconds
+    // (which is more than sufficient resolution for this). This is done to
+    // mittigate the risk of counter overflow. 
+	// The existing implementation is commented and not removed for future reference
+	// if required.
+    TTime now;
 	now.UniversalTime();
 #ifdef I64LOW
 	return I64LOW(now.Int64());
 #else
 	return (TUint32)now.Int64().GetTInt();
 #endif
+*/
 	}
 
 /**