|
Mixe for Privacy and Anonymity in the Internet
|
Not thread safe! More...
#include <CASingleSocketGroup.hpp>
Public Member Functions | |
| CASingleSocketGroup (bool bWrite) | |
Static Public Member Functions | |
| static SINT32 | select_once (CASocket &s, bool bWrite, UINT32 time_ms) |
Not thread safe!
Definition at line 36 of file CASingleSocketGroup.hpp.
| CASingleSocketGroup::CASingleSocketGroup | ( | bool | bWrite | ) | [inline] |
Definition at line 39 of file CASingleSocketGroup.hpp.
:CASocketGroup(bWrite) { }
| static SINT32 CASingleSocketGroup::select_once | ( | CASocket & | s, |
| bool | bWrite, | ||
| UINT32 | time_ms | ||
| ) | [inline, static] |
Definition at line 43 of file CASingleSocketGroup.hpp.
References E_TIMEDOUT, E_UNKNOWN, CASocket::getSocket(), CASocketGroup::select(), and SET_NET_ERROR.
Referenced by CASocket::sendFully(), and CASocket::sendFullyTimeOut().
{
fd_set fdset;
FD_ZERO(&fdset);
#pragma warning( push )
#pragma warning( disable : 4127 ) //Disable: Bedingter Ausdruck ist konstant
FD_SET(s.getSocket(),&fdset);
#pragma warning( pop )
SINT32 ret;
timeval ti;
ti.tv_sec=0;
ti.tv_usec=time_ms*1000;
if(bWrite)
ret=::select(1,NULL,&fdset,NULL,&ti);
else
ret=::select(1,&fdset,NULL,NULL,&ti);
if(ret>0)
return ret;
else if(ret==0)
{
SET_NET_ERROR(E_TIMEDOUT);
return E_TIMEDOUT;
}
return E_UNKNOWN;
}
1.7.6.1