X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fsocket.cpp;h=a4675f593b6bc95ed9e0d4ad40f442e5bcf78ee1;hb=f9cc7ff2e1e5af865220e9fbe16673619ecb78bd;hp=2cc3d88dbce4b2451909f5022b15008764bc7b2e;hpb=a81c41acd873cda7f40bca634782230d9e57dc4f;p=libs%2Fnet.git diff --git a/source/socket.cpp b/source/socket.cpp index 2cc3d88..a4675f5 100644 --- a/source/socket.cpp +++ b/source/socket.cpp @@ -4,7 +4,8 @@ #include #endif #include -#include +#include +#include #include #include "socket.h" @@ -109,10 +110,6 @@ void Socket::bind(const SockAddr &addr) local_addr = addr.copy(); } -/** -Closes the socket. Most operations on the socket will throw an exception after -this. -*/ void Socket::close() { if(handle==MSP_NET_INVALID_SOCKET_HANDLE) @@ -140,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