#include <errno.h>
#include <string>
#include "assa/LogMask.h"
Go to the source code of this file.
Namespaces | |
namespace | ASSA |
Defines | |
#define | _BSDTYPES_DEFINED |
#define | BAD_HANDLER -1 |
Sort out WIN32/mingw oddities. | |
Typedefs | |
typedef unsigned char | u_char |
typedef unsigned short | u_short |
typedef unsigned int | u_int |
typedef unsigned long | u_long |
typedef int | handler_t |
Functions | |
bool | is_valid_handler (handler_t socket_) |
Detect socket() error in a portable way. | |
void | disable_handler (handler_t &socket_) |
Set socket descriptor to invalid value in a portable way. | |
int | get_errno () |
Fetch error number in a portable way. | |
void | set_errno (int new_errno_) |
Set error number in a portable way. |
|
Definition at line 41 of file Logger_Impl.h. |
|
Sort out WIN32/mingw oddities.
Definition at line 79 of file Logger_Impl.h. Referenced by ASSA::disable_handler(), and ASSA::is_valid_handler(). |
|
Definition at line 80 of file Logger_Impl.h. |
|
Definition at line 36 of file Logger_Impl.h. |
|
Definition at line 38 of file Logger_Impl.h. |
|
Definition at line 39 of file Logger_Impl.h. |
|
Definition at line 37 of file Logger_Impl.h. |
|
Set socket descriptor to invalid value in a portable way. socket_ is set to the value out of valid range. Definition at line 106 of file Logger_Impl.h. References BAD_HANDLER. Referenced by ASSA::IPv4Socket::accept(), ASSA::Socket::close_handler(), and ASSA::IPv4Socket::open(). 00107 { 00108 socket_ = BAD_HANDLER; 00109 }
|
|
Fetch error number in a portable way.
Definition at line 113 of file Logger_Impl.h. Referenced by ASSA::IPv4Socket::connect(), ASSA::Connector< SERVICE_HANDLER, PEER_CONNECTOR >::connect(), ASSA::Connector< SERVICE_HANDLER, PEER_CONNECTOR >::handle_write(), ASSA::IPv4Socket::read(), ASSA::Socketbuf::sys_read(), and ASSA::Socketbuf::underflow(). 00114 { 00115 int myerrno; 00116 #if defined (WIN32) 00117 myerrno = WSAGetLastError (); 00118 #else 00119 myerrno = errno; 00120 #endif 00121 return myerrno; 00122 }
|
|
Detect socket() error in a portable way.
Definition at line 98 of file Logger_Impl.h. References BAD_HANDLER. Referenced by ASSA::IPv4Socket::accept(), ASSA::Socket::clear(), ASSA::IPv4Socket::clone(), ASSA::IPv4Socket::close(), ASSA::IPv4Socket::connect(), ASSA::IPv4Socket::open(), ASSA::IPv4Socket::read(), ASSA::Reactor::removeIOHandler(), and ASSA::IPv4Socket::write(). 00099 { 00100 return (socket_ != BAD_HANDLER); 00101 }
|
|
Set error number in a portable way.
Definition at line 126 of file Logger_Impl.h. Referenced by ASSA::Connector< SERVICE_HANDLER, PEER_CONNECTOR >::connect(), ASSA::Connector< SERVICE_HANDLER, PEER_CONNECTOR >::doSync(), ASSA::Connector< SERVICE_HANDLER, PEER_CONNECTOR >::handle_timeout(), and ASSA::Connector< SERVICE_HANDLER, PEER_CONNECTOR >::handle_write(). 00127 { 00128 #if defined (WIN32) 00129 WSASetLastError (new_errno_); 00130 #else 00131 errno = new_errno_; 00132 #endif 00133 }
|