Mixe for Privacy and Anonymity in the Internet
Public Member Functions | Static Public Member Functions | List of all members
CASingleSocketGroup Class Reference

Not thread safe! More...

#include <CASingleSocketGroup.hpp>

Inheritance diagram for CASingleSocketGroup:
Collaboration diagram for CASingleSocketGroup:

Public Member Functions

 CASingleSocketGroup (bool bWrite)
 
- Public Member Functions inherited from CASocketGroup
 CASocketGroup (bool bWrite)
 
 ~CASocketGroup ()
 
SINT32 setPoolForWrite (bool bWrite)
 
SINT32 add (SOCKET &s)
 
SINT32 add (CASocket &s)
 
SINT32 add (CAMuxSocket &s)
 
SINT32 remove (CASocket &s)
 
SINT32 remove (CAMuxSocket &s)
 
SINT32 select ()
 
SINT32 select (UINT32 time_ms)
 Waits for events on the sockets. More...
 
bool isSignaled (CASocket &s)
 
bool isSignaled (CASocket *ps)
 
bool isSignaled (CAMuxSocket &s)
 

Static Public Member Functions

static SINT32 select_once (CASocket &s, bool bWrite, UINT32 time_ms)
 

Detailed Description

Not thread safe!

Definition at line 38 of file CASingleSocketGroup.hpp.

Constructor & Destructor Documentation

◆ CASingleSocketGroup()

CASingleSocketGroup::CASingleSocketGroup ( bool  bWrite)
inline

Definition at line 41 of file CASingleSocketGroup.hpp.

41  :CASocketGroup(bWrite)
42  {
43  }
CASocketGroup(bool bWrite)

Member Function Documentation

◆ select_once()

static SINT32 CASingleSocketGroup::select_once ( CASocket s,
bool  bWrite,
UINT32  time_ms 
)
inlinestatic

Definition at line 45 of file CASingleSocketGroup.hpp.

46  {
47  fd_set fdset;
48  FD_ZERO(&fdset);
49  #pragma warning( push )
50  #pragma warning( disable : 4127 ) //Disable: Bedingter Ausdruck ist konstant
51  FD_SET(s.getSocket(),&fdset);
52  #pragma warning( pop )
53 
54  SINT32 ret;
55  timeval ti;
56  ti.tv_sec=0;
57  ti.tv_usec=time_ms*1000;
58  if(bWrite)
59  ret=::select(1,NULL,&fdset,NULL,&ti);
60  else
61  ret=::select(1,&fdset,NULL,NULL,&ti);
62  if(ret>0)
63  return ret;
64  else if(ret==0)
65  {
67  return E_TIMEDOUT;
68  }
69  return E_UNKNOWN;
70  }
#define SET_NET_ERROR(x)
Definition: StdAfx.h:470
signed int SINT32
Definition: basetypedefs.h:132
SOCKET getSocket()
Returns the number of the Socket used.
Definition: CASocket.hpp:87
#define E_UNKNOWN
Definition: errorcodes.hpp:3
#define E_TIMEDOUT
Definition: errorcodes.hpp:10

References E_TIMEDOUT, E_UNKNOWN, CASocket::getSocket(), CASocketGroup::select(), and SET_NET_ERROR.

Here is the call graph for this function:

The documentation for this class was generated from the following file: