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

Not thread safe! More...

#include <CASingleSocketGroup.hpp>

Inheritance diagram for CASingleSocketGroup:
[legend]
Collaboration diagram for CASingleSocketGroup:
[legend]

List of all members.

Public Member Functions

 CASingleSocketGroup (bool bWrite)

Static Public Member Functions

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

Detailed Description

Not thread safe!

Definition at line 36 of file CASingleSocketGroup.hpp.


Constructor & Destructor Documentation

CASingleSocketGroup::CASingleSocketGroup ( bool  bWrite) [inline]

Definition at line 39 of file CASingleSocketGroup.hpp.

                                      :CASocketGroup(bWrite)
      {
      }

Member Function Documentation

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;
        }

Here is the call graph for this function:


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