]> git.tdb.fi Git - libs/net.git/commitdiff
Update TimeDelta to timeval conversion
authorMikko Rasa <tdb@tdb.fi>
Thu, 4 Aug 2011 22:42:33 +0000 (01:42 +0300)
committerMikko Rasa <tdb@tdb.fi>
Thu, 4 Aug 2011 22:42:33 +0000 (01:42 +0300)
source/socket.cpp

index 5afb9c275ffa47e599fcdb02533f79e35ab52626..a4675f593b6bc95ed9e0d4ad40f442e5bcf78ee1 100644 (file)
@@ -5,6 +5,7 @@
 #endif
 #include <iostream>
 #include <msp/strings/format.h>
+#include <msp/time/rawtime_private.h>
 #include <msp/time/units.h>
 #include "socket.h"
 
@@ -136,8 +137,7 @@ void Socket::close()
 void Socket::set_timeout(const Time::TimeDelta &timeout)
 {
 #ifndef WIN32
-       timeval tv;
-       timeout.fill_timeval(tv);
+       timeval tv = Time::rawtime_to_timeval(timeout.raw());
        set_option(SOL_SOCKET, SO_RCVTIMEO, &tv, sizeof(timeval));
        set_option(SOL_SOCKET, SO_SNDTIMEO, &tv, sizeof(timeval));
 #else