networkprotocols/tcpipv4v6prt/inc/tcp.h
changeset 56 ea8d11a88e23
parent 37 052078dda061
--- a/networkprotocols/tcpipv4v6prt/inc/tcp.h	Wed Aug 25 09:23:03 2010 +0530
+++ b/networkprotocols/tcpipv4v6prt/inc/tcp.h	Mon Aug 30 12:20:22 2010 +0530
@@ -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)
@@ -782,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
+*/
 	}
 
 /**