Loading...
Searching...
No Matches
ASSA Namespace Reference

## Namespaces

namespace | Log
namespace | Utils

## Classes

class | Acceptor
class | Address
class | AutoPtr
| AutoPtr is based on SGI implementation of a auto_ptr template that makes memory handling a little bit easier. More...
class | AutoPtrArray
| AutoPtrArray handles memory management of an array of objects. More...
class | AutoPtrArrayRef
| A wrapper class to provide AutoPtr with reference semantics. More...
class | AutoPtrRef
| A wrapper class to provide AutoPtr with reference semantics. More...
struct | Bfunc
| Bfunc is used by PriorityQueue_impl. More...
class | CFUNC_Handler
| CFUNC_Handler class. More...
class | CharInBuffer
| CharInBuffer is a bucket for the character-based streams/messages. More...
class | ChildStatusHandler
| A helper class of Fork. More...
class | CmdLineOpts
| Class CmdLineOpts. More...
class | Connector
| Connector is a template class for initialization of communication services. More...
class | ConUDPSocket
class | Destroyer
class | DiagnosticContext
| Class DiagnosticContext tracks who deep a function is in the calling stack. More...
class | EventHandler
| EventHandler class. More...
class | FdSet
| Class FdSet. More...
class | FileLogger
class | fnode_t
| forknode_t class. More...
class | Fork
| Fork class is a simple wrapper around C library function fork(). More...
class | ForkList
| ForkList is a singleton class that keeps a list of all forked children. More...
class | GenServer
class | IdSet
class | INETAddress
class | IniFile
class | io_ptrs
| io_ptrs structure. More...
class | IPv4Socket
struct | Less
| Less is borrowed from STL implementation. More...
class | Logger
class | Logger_Impl
class | MaskSet
class | MemDump
class | Option
| Option class. More...
class | PidFileLock
class | Pipe
class | PriorityQueue
class | PriorityQueue_Heap
class | PriorityQueue_Impl
| Class PriorityQueue_Impl. More...
class | PriorityQueue_STLPQ
class | Reactor
class | Regexp
| Regexp class. More...
class | RemoteLogger
class | Repository
class | Semaphore
class | ServiceHandler
class | SigAction
class | SIGALRMHandler
| Class SIGALRMHandler handles SIGALRM signal. More...
class | SIGCHLDHandler
| Class SIGCHLDHandler handles SIGCHLD signal. More...
class | SigHandler
class | SigHandlers
class | SigHandlersList
| SigHandlersList class. More...
class | SIGINTHandler
| SIGINTHandler handles SIGINT signal. More...
class | SIGPOLLHandler
| Class SIGPOLLHandler handles SIGPOLL signal. More...
class | SigSet
class | SIGUSR1Handler
| Class SIGUSR1Handler. More...
class | SIGUSR2Handler
| Class SIGUSR2Handler handles SIGUSR2 signal. More...
class | Singleton
class | Socket
class | Socketbuf
class | StdOutLogger
class | Streambuf
| Streambuf class. More...
class | Timer
struct | TimerCompare
| TimerCompare class compares two Timers base on their expiration timestamp. More...
class | TimerCountdown
class | TimerQueue
class | TimeVal
class | UDPSocket
class | UnConUDPSocket
class | UNIXAddress
class | xdrIOBuffer

## Typedefs

typedef struct sockaddr | SA
typedef struct sockaddr_in | SA_IN
typedef struct sockaddr_un | SA_UN
typedef unsigned long | TimerId
| Timer Id is used in handle_timeout() calls.
typedef int(EventHandler::* | EH_IO_Callback) (int)
| A type for the pointer to I/O-related callback member function of class EventHandler.

## Enumerations

enum | ConnectMode { sync , async }
enum | EventType { READ_EVENT = 0x01 , WRITE_EVENT = 0x02 , EXCEPT_EVENT = 0x04 , TIMEOUT_EVENT = 0x10 , SIGNAL_EVENT = 0x20 , RWE_EVENTS = 0x07 , ALL_EVENTS = 0x37 }
| EventType defines events types that Reactor understands. More...

enum

Group {
TRACE = 0x00000001 , APP = 0x00000002 , USR1 = 0x00000004 , USR2 = 0x00000008 ,
USR3 = 0x00000010 , ALL_APPS = 0x0000001F , ASSAERR = 0x00000020 , PIDFLOCK = 0x00000040 ,
CMDLINEOPTS = 0x00000080 , SEM = 0x00000100 , SIGHAND = 0x00000200 , REACT = 0x00000400 ,
REACTTRACE = 0x00000800 , SOCK = 0x00001000 , SOCKTRACE = 0x00002000 , XDRBUF = 0x00004000 ,
XDRBUFTRACE = 0x00008000 , STRMBUF = 0x00010000 , STRMBUFTRACE = 0x00020000 , FORK = 0x00040000 ,
SIGACT = 0x00080000 , PIPE = 0x00100000 , CHARINBUF = 0x00200000 , ADDRESS = 0x00400000 ,
INIFILE = 0x00800000 , REGEXP = 0x01000000 , RES5 = 0x02000000 , RES6 = 0x04000000 ,
RES7 = 0x08000000 , RES8 = 0x10000000 , RES9 = 0x20000000 , RES10 = 0x40000000 ,
ALL_LIB = 0x7FFFFFE0 , ALL = 0x7FFFFFFF , NONE = 0x00000000
}

enum | marker_t { FUNC_MSG , FUNC_ENTRY , FUNC_EXIT }

## Functions

Socket & | operator>> (Socket &s_, CharInBuffer &b_)
| Regardless of the delimeter size, which can be >1, add the character received to the buffer and compare the end of the buffer with the delimeter.
bool | isReadEvent (EventType e_)
bool | isWriteEvent (EventType e_)
bool | isExceptEvent (EventType e_)
bool | isTimeoutEvent (EventType e_)
bool | isSignalEvent (EventType e_)
bool | isRWEEvents (EventType e_)
bool | isAllEvents (EventType e_)
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.
Socket & | flush (Socket &os_)
| flush manipulator.
Socket & | endl (Socket &os_)
| endl manipulator.
Socket & | ends (Socket &os_)
| ends manipulator.
TimeVal | operator+ (const TimeVal &lhs_, const TimeVal &rhs_)
TimeVal | operator- (const TimeVal &lhs_, const TimeVal &rhs_)
bool | operator> (const TimeVal &lhs_, const TimeVal &rhs_)
bool | operator!= (const TimeVal &lhs_, const TimeVal &rhs_)
bool | operator<= (const TimeVal &lhs_, const TimeVal &rhs_)
bool | operator>= (const TimeVal &lhs_, const TimeVal &rhs_)
Socket & | operator>> (Socket &s_, xdrIOBuffer &b_)

## Typedef Documentation

## EH_IO_Callback

int(EventHandler::* ASSA::EH_IO_Callback)(int)

A type for the pointer to I/O-related callback member function of class EventHandler.

These are:

- handle_read ()
- handle_write ()
- handle_except ()

See also
  EventHandler

Definition at line 236 of file EventHandler.h.

## SA

typedef struct sockaddr ASSA::SA

Definition at line 33 of file Address.h.

## SA_IN

typedef struct sockaddr_in ASSA::SA_IN

Definition at line 34 of file Address.h.

## SA_UN

typedef struct sockaddr_un ASSA::SA_UN

Definition at line 44 of file Address.h.

## TimerId

typedef unsigned long ASSA::TimerId

Timer Id is used in handle_timeout() calls.

Definition at line 27 of file EventHandler.h.

## Enumeration Type Documentation

## ConnectMode

enum ASSA::ConnectMode

Enumerator
sync | Synchronous connection mode.
async | Asynchronous connection mode.

Definition at line 43 of file Connector.h.

{
sync,
async
};
ASSA::sync
@ sync
Synchronous connection mode.
Definition Connector.h:44
ASSA::async
@ async
Asynchronous connection mode.
Definition Connector.h:45

## EventType

enum ASSA::EventType

EventType defines events types that Reactor understands.

Enumerator
READ_EVENT | Notify when there will be at least 1 byte available for reading from IO channel without blocking .
WRITE_EVENT | Notify when there will be room for at least 1 byte to be written to IO channel without blocking.
EXCEPT_EVENT | Notify when there is an exception condition detected in TCP layer.
TIMEOUT_EVENT | Notify about expired timer.
SIGNAL_EVENT | Notify when UNIX signal is delivered by OS.
RWE_EVENTS | READ_EVENT | WRITE_EVENT | EXCEPT_EVENT
ALL_EVENTS | Mask that includes all events.

Definition at line 34 of file EventHandler.h.

{
READ_EVENT = 0x01,
WRITE_EVENT = 0x02,
EXCEPT_EVENT = 0x04,
TIMEOUT_EVENT = 0x10,
SIGNAL_EVENT = 0x20,
RWE_EVENTS = 0x07,
ALL_EVENTS = 0x37
};
ASSA::WRITE_EVENT
@ WRITE_EVENT
Notify when there will be room for at least 1 byte to be written to IO channel without blocking.
Definition EventHandler.h:39
ASSA::ALL_EVENTS
@ ALL_EVENTS
Mask that includes all events.
Definition EventHandler.h:47
ASSA::SIGNAL_EVENT
@ SIGNAL_EVENT
Notify when UNIX signal is delivered by OS.
Definition EventHandler.h:45
ASSA::READ_EVENT
@ READ_EVENT
Notify when there will be at least 1 byte available for reading from IO channel without blocking .
Definition EventHandler.h:36
ASSA::RWE_EVENTS
@ RWE_EVENTS
READ_EVENT | WRITE_EVENT | EXCEPT_EVENT
Definition EventHandler.h:46
ASSA::EXCEPT_EVENT
@ EXCEPT_EVENT
Notify when there is an exception condition detected in TCP layer.
Definition EventHandler.h:42
ASSA::TIMEOUT_EVENT
@ TIMEOUT_EVENT
Notify about expired timer.
Definition EventHandler.h:44

## Group

enum ASSA::Group

Enumerator
TRACE | Function call trace
APP | Application-level messages
USR1 | Additional application-level messages
USR2 | Additional application-level messages
USR3 | Additional application-level messages
ALL_APPS | All application-level messages
ASSAERR | ASSA and system errors
PIDFLOCK | Class PidFileLock messages
CMDLINEOPTS | Class CmdLineOpts messages
SEM | Class Semaphore messages
SIGHAND | Class SigHandler(s) messages
REACT | Class Reactor/PrioriyQueue messages
REACTTRACE | Extended Reactor/PrioriyQueue messages
SOCK | Class Socket & friends messages
SOCKTRACE | Extended Socket & friends messages
XDRBUF | Class xdrIOBuffer messages
XDRBUFTRACE | Extended xdrIOBuffer messages
STRMBUF | Class Streambuf & friends messages
STRMBUFTRACE | Extended Streambuf & friends messages
FORK | Class Fork messages
SIGACT | Class SigACtion messages
PIPE | Class Pipe messages
CHARINBUF | Class CharInBuffer messages
ADDRESS | Class Address & friends messages
INIFILE | Class IniFile messages
REGEXP | Class RegExp messages
RES5 | Reserved for future use
RES6 | Reserved for future use
RES7 | Reserved for future use
RES8 | Reserved for future use
RES9 | Reserved for future use
RES10 | Reserved for future use
ALL_LIB | All library messages
ALL | All messages: library + application
NONE | Total silence

Definition at line 25 of file LogMask.h.

{
TRACE = 0x00000001,
APP = 0x00000002,
USR1 = 0x00000004,
USR2 = 0x00000008,
USR3 = 0x00000010,
/*-----------------------------------------------------------------------*/
ALL_APPS = 0x0000001F,
/*-----------------------------------------------------------------------*/
ASSAERR = 0x00000020,
PIDFLOCK = 0x00000040,
CMDLINEOPTS = 0x00000080,
SEM = 0x00000100,
SIGHAND = 0x00000200,
REACT = 0x00000400,
REACTTRACE = 0x00000800,
SOCK = 0x00001000,
SOCKTRACE = 0x00002000,
XDRBUF = 0x00004000,
XDRBUFTRACE = 0x00008000,
STRMBUF = 0x00010000,
STRMBUFTRACE = 0x00020000,
FORK = 0x00040000,
SIGACT = 0x00080000,
PIPE = 0x00100000,
CHARINBUF = 0x00200000,
ADDRESS = 0x00400000,
INIFILE = 0x00800000,
REGEXP = 0x01000000,
RES5 = 0x02000000,
RES6 = 0x04000000,
RES7 = 0x08000000,
RES8 = 0x10000000,
RES9 = 0x20000000,
RES10 = 0x40000000,
/*-----------------------------------------------------------------------*/
ALL_LIB = 0x7FFFFFE0,
ALL = 0x7FFFFFFF,
NONE = 0x00000000
};
ASSA::PIPE
@ PIPE
Class Pipe messages
Definition LogMask.h:49
ASSA::INIFILE
@ INIFILE
Class IniFile messages
Definition LogMask.h:52
ASSA::RES7
@ RES7
Reserved for future use
Definition LogMask.h:56
ASSA::FORK
@ FORK
Class Fork messages
Definition LogMask.h:47
ASSA::ADDRESS
@ ADDRESS
Class Address & friends messages
Definition LogMask.h:51
ASSA::REACT
@ REACT
Class Reactor/PrioriyQueue messages
Definition LogMask.h:39
ASSA::SOCK
@ SOCK
Class Socket & friends messages
Definition LogMask.h:41
ASSA::SOCKTRACE
@ SOCKTRACE
Extended Socket & friends messages
Definition LogMask.h:42
ASSA::REGEXP
@ REGEXP
Class RegExp messages
Definition LogMask.h:53
ASSA::USR3
@ USR3
Additional application-level messages
Definition LogMask.h:30
ASSA::SEM
@ SEM
Class Semaphore messages
Definition LogMask.h:37
ASSA::SIGHAND
@ SIGHAND
Class SigHandler(s) messages
Definition LogMask.h:38
ASSA::XDRBUF
@ XDRBUF
Class xdrIOBuffer messages
Definition LogMask.h:43
ASSA::RES6
@ RES6
Reserved for future use
Definition LogMask.h:55
ASSA::NONE
@ NONE
Total silence
Definition LogMask.h:63
ASSA::RES8
@ RES8
Reserved for future use
Definition LogMask.h:57
ASSA::USR2
@ USR2
Additional application-level messages
Definition LogMask.h:29
ASSA::ALL_LIB
@ ALL_LIB
All library messages
Definition LogMask.h:61
ASSA::APP
@ APP
Application-level messages
Definition LogMask.h:27
ASSA::RES5
@ RES5
Reserved for future use
Definition LogMask.h:54
ASSA::CMDLINEOPTS
@ CMDLINEOPTS
Class CmdLineOpts messages
Definition LogMask.h:36
ASSA::STRMBUFTRACE
@ STRMBUFTRACE
Extended Streambuf & friends messages
Definition LogMask.h:46
ASSA::ASSAERR
@ ASSAERR
ASSA and system errors
Definition LogMask.h:34
ASSA::USR1
@ USR1
Additional application-level messages
Definition LogMask.h:28
ASSA::XDRBUFTRACE
@ XDRBUFTRACE
Extended xdrIOBuffer messages
Definition LogMask.h:44
ASSA::ALL_APPS
@ ALL_APPS
All application-level messages
Definition LogMask.h:32
ASSA::STRMBUF
@ STRMBUF
Class Streambuf & friends messages
Definition LogMask.h:45
ASSA::TRACE
@ TRACE
Function call trace
Definition LogMask.h:26
ASSA::REACTTRACE
@ REACTTRACE
Extended Reactor/PrioriyQueue messages
Definition LogMask.h:40
ASSA::CHARINBUF
@ CHARINBUF
Class CharInBuffer messages
Definition LogMask.h:50
ASSA::SIGACT
@ SIGACT
Class SigACtion messages
Definition LogMask.h:48
ASSA::ALL
@ ALL
All messages: library + application
Definition LogMask.h:62
ASSA::PIDFLOCK
@ PIDFLOCK
Class PidFileLock messages
Definition LogMask.h:35
ASSA::RES10
@ RES10
Reserved for future use
Definition LogMask.h:59
ASSA::RES9
@ RES9
Reserved for future use
Definition LogMask.h:58

## marker_t

enum ASSA::marker_t

Enumerator
FUNC_MSG |
FUNC_ENTRY |
FUNC_EXIT |

Definition at line 67 of file LogMask.h.

{
FUNC_MSG,
FUNC_ENTRY,
FUNC_EXIT
};
ASSA::FUNC_ENTRY
@ FUNC_ENTRY
Definition LogMask.h:69
ASSA::FUNC_MSG
@ FUNC_MSG
Definition LogMask.h:68
ASSA::FUNC_EXIT
@ FUNC_EXIT
Definition LogMask.h:70

## Function Documentation

## disable_handler()

void ASSA::disable_handler | ( | handler_t & | socket_ | ) |

inline

Set socket descriptor to invalid value in a portable way.

socket_ is set to the value out of valid range.

Definition at line 108 of file Logger_Impl.h.

{
socket_ = BAD_HANDLER;
}
BAD_HANDLER
#define BAD_HANDLER
Sort out WIN32/mingw oddities.
Definition Logger_Impl.h:81
ASSA::AutoPtrRef
A wrapper class to provide AutoPtr with reference semantics.
Definition AutoPtr.h:32

References BAD_HANDLER.

Referenced by ASSA::IPv4Socket::accept(), ASSA::Socket::close_handler(), and ASSA::IPv4Socket::open().

## endl()

Socket & ASSA::endl | ( | Socket & | os_ | ) |

inline

endl manipulator.

If you want to insert a newline character ('
') to terminate a text line, you should favor the manipulator endl. This manipulator inserts a newline character and also flushes the stream buffer.

Author
  Vladislav Grinchenko

Definition at line 602 of file Socket.h.

{
char c = '\n';
os_.write (&c, 1);
os_.flush ();
return (os_);
}

## ends()

Socket & ASSA::ends | ( | Socket & | os_ | ) |

inline

ends manipulator.

You can insert a null character (without flushing the output stream) with the manipulator ends. A common use for a Socket object is to mediate output to a stream buffer that constructs an in-memory character sequence. Such a sequence wants a terminating null character. The manipulator ends provides highly visible evidence that the null character is indeed being supplied.

Author
  Vladislav Grinchenko

Definition at line 622 of file Socket.h.

{
char c = '\0';
os_.write (&c, 1);
return (os_);
}

## flush()

Socket & ASSA::flush | ( | Socket & | os_ | ) |

inline

flush manipulator.

Flush a stream buffer.

Definition at line 587 of file Socket.h.

{
os_.flush ();
return (os_);
}

Referenced by ASSA::RemoteLogger::log_close(), ASSA::RemoteLogger::log_func(), ASSA::RemoteLogger::log_msg(), ASSA::RemoteLogger::log_open(), and ASSA::RemoteLogger::log_resync().

## get_errno()

int ASSA::get_errno | ( |  | ) |

inline

Fetch error number in a portable way.

Definition at line 115 of file Logger_Impl.h.

{
int myerrno;
#if defined (WIN32)
myerrno = WSAGetLastError ();
#else
myerrno = errno;
#endif
return myerrno;
}

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().

## is_valid_handler()

bool ASSA::is_valid_handler | ( | handler_t | socket_ | ) |

inline

Detect socket() error in a portable way.

Returns
  true if socket is in valid range; false otherwise.

Definition at line 100 of file Logger_Impl.h.

{
return (socket_ != BAD_HANDLER);
}

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().

## isAllEvents()

bool ASSA::isAllEvents | ( | EventType | e_ | ) |

inline

Definition at line 87 of file EventHandler.h.

{
return isReadEvent (e_) && isWriteEvent (e_) && isExceptEvent (e_) &&
isSignalEvent (e_) && isTimeoutEvent (e_) ;
}
ASSA::isReadEvent
bool isReadEvent(EventType e_)
Definition EventHandler.h:51
ASSA::isExceptEvent
bool isExceptEvent(EventType e_)
Definition EventHandler.h:63
ASSA::isSignalEvent
bool isSignalEvent(EventType e_)
Definition EventHandler.h:75
ASSA::isTimeoutEvent
bool isTimeoutEvent(EventType e_)
Definition EventHandler.h:69
ASSA::isWriteEvent
bool isWriteEvent(EventType e_)
Definition EventHandler.h:57

References isExceptEvent(), isReadEvent(), isSignalEvent(), isTimeoutEvent(), and isWriteEvent().

## isExceptEvent()

bool ASSA::isExceptEvent | ( | EventType | e_ | ) |

inline

Definition at line 63 of file EventHandler.h.

{
return (e_ & EXCEPT_EVENT) == EXCEPT_EVENT;
}

References EXCEPT_EVENT.

Referenced by isAllEvents(), isRWEEvents(), ASSA::Reactor::registerIOHandler(), and ASSA::Reactor::removeHandler().

## isReadEvent()

bool ASSA::isReadEvent | ( | EventType | e_ | ) |

inline

Definition at line 51 of file EventHandler.h.

{
return (e_ & READ_EVENT) == READ_EVENT;
}

References READ_EVENT.

Referenced by isAllEvents(), isRWEEvents(), ASSA::Reactor::registerIOHandler(), and ASSA::Reactor::removeHandler().

## isRWEEvents()

bool ASSA::isRWEEvents | ( | EventType | e_ | ) |

inline

Definition at line 81 of file EventHandler.h.

{
return isReadEvent (e_) && isWriteEvent (e_) && isExceptEvent (e_);
}

References isExceptEvent(), isReadEvent(), and isWriteEvent().

## isSignalEvent()

bool ASSA::isSignalEvent | ( | EventType | e_ | ) |

inline

Definition at line 75 of file EventHandler.h.

{
return (e_ & SIGNAL_EVENT) == SIGNAL_EVENT;
}

References SIGNAL_EVENT.

Referenced by isAllEvents(), and ASSA::Reactor::registerIOHandler().

## isTimeoutEvent()

bool ASSA::isTimeoutEvent | ( | EventType | e_ | ) |

inline

Definition at line 69 of file EventHandler.h.

{
return (e_ & TIMEOUT_EVENT) == TIMEOUT_EVENT;
}

References TIMEOUT_EVENT.

Referenced by isAllEvents(), ASSA::Reactor::registerIOHandler(), and ASSA::Reactor::removeHandler().

## isWriteEvent()

bool ASSA::isWriteEvent | ( | EventType | e_ | ) |

inline

Definition at line 57 of file EventHandler.h.

{
return (e_ & WRITE_EVENT) == WRITE_EVENT;
}

References WRITE_EVENT.

Referenced by isAllEvents(), isRWEEvents(), ASSA::Reactor::registerIOHandler(), and ASSA::Reactor::removeHandler().

## operator!=()

bool ASSA::operator!= | ( | const TimeVal & | lhs_,
|  | const TimeVal & | rhs_
| ) |  |

inline

Definition at line 312 of file TimeVal.h.

{
return !( lhs_ == rhs_ );
}

## operator+()

TimeVal ASSA::operator+ | ( | const TimeVal & | lhs_,
|  | const TimeVal & | rhs_
| ) |  |

inline

Definition at line 273 of file TimeVal.h.

{
TimeVal temp(lhs_);
temp += rhs_;
temp.normalize ();
return temp;
}
ASSA::TimeVal
Definition TimeVal.h:31

## operator-()

TimeVal ASSA::operator- | ( | const TimeVal & | lhs_,
|  | const TimeVal & | rhs_
| ) |  |

inline

Definition at line 282 of file TimeVal.h.

{
TimeVal temp(lhs_);
temp -= rhs_;
temp.normalize ();
return temp;
}

## operator<=()

bool ASSA::operator<= | ( | const TimeVal & | lhs_,
|  | const TimeVal & | rhs_
| ) |  |

inline

Definition at line 317 of file TimeVal.h.

{
return !(rhs_ < lhs_);
}

## operator>()

bool ASSA::operator> | ( | const TimeVal & | lhs_,
|  | const TimeVal & | rhs_
| ) |  |

inline

Definition at line 306 of file TimeVal.h.

{
return rhs_ < lhs_;
}

## operator>=()

bool ASSA::operator>= | ( | const TimeVal & | lhs_,
|  | const TimeVal & | rhs_
| ) |  |

inline

Definition at line 324 of file TimeVal.h.

{
return !(lhs_ < rhs_);
}

## operator>>() [1/2]

Socket & ASSA::operator>> | ( | ASSA::Socket & | s_,
|  | ASSA::CharInBuffer & | b_
| ) |  |

Regardless of the delimeter size, which can be >1, add the character received to the buffer and compare the end of the buffer with the delimeter.

Read bytes from Socket stream until either record delimiter is detected, or EOF occured, or Socket stream is exhausted.

If match, bite off delimiter and set the state to complete. If not, continue reading till either there is no more characters to read, or Socket error (Fail or EOF), or buffer overflow. If overflow occurs, set the state to 'error' and terminate.

Definition at line 80 of file CharInBuffer.cpp.

{
trace_with_mask ("Socket >> CharInBuffer", CHARINBUF);
register char c;
if (b_.state () != CharInBuffer::waiting) {
DL((CHARINBUF,"Wrong state %s\n", b_.state_name (b_.state ())));
return s_;
}
while (s_.read (&c, 1) == 1)
{
b_.m_buffer += c;
if (b_.m_buffer.size() < b_.m_delimiter.size()) { // Bug # 1252926
continue;
}
if (b_.m_buffer.substr (
b_.m_buffer.size ()-b_.m_delimiter.size ()) == b_.m_delimiter)
{
b_.chop ();
b_.m_state = CharInBuffer::complete;
return s_;
}
if (b_.m_buffer.length () >= b_.m_max_size) {
b_.m_state = CharInBuffer::error;
break;
}
}
if (!s_) { // EOF or error
b_.state (CharInBuffer::error);
}
return s_;
}
DL
#define DL(X)
A macro for writing debug message to the Logger.
Definition Logger.h:273
trace_with_mask
#define trace_with_mask(s, m)
trace_with_mask() is used to trace function call chain in C++ program.
Definition Logger.h:437
ASSA::CharInBuffer::complete
@ complete
matched end-of-record - full record
Definition CharInBuffer.h:88
ASSA::CharInBuffer::error
@ error
overflow or Socket I/O error
Definition CharInBuffer.h:89
ASSA::CharInBuffer::waiting
@ waiting
incomplete record is in the buffer
Definition CharInBuffer.h:87

## operator>>() [2/2]

Socket & ASSA::operator>> | ( | Socket & | s_,
|  | xdrIOBuffer & | b_
| ) |  |

Definition at line 25 of file xdrIOBuffer.cpp.

{
trace_with_mask("Socket >> xdrIOBuffer", XDRBUFTRACE);
DL((XDRBUFTRACE,"Buffer Initially:\n"));
b_.dump ();
if (b_.m_state != xdrIOBuffer::waiting) {
EL((ASSAERR,"Wrong state: %s\n", b_.get_state ().c_str ()));
return s_;
}
int expected = b_.m_sz - b_.size ();
DL((XDRBUFTRACE,"Bytes expected: %d\n",expected));
DL((XDRBUFTRACE,"Bytes in Socket buffer(s): %d\n", s_.getBytesAvail ()));
int ret;
if ((ret = s_.read (b_.m_ptr, expected)) <= 0)
{
#if defined(WIN32)
if (WSAGetLastError () != WSAEWOULDBLOCK) {
WSASetLastError (0);
EL((ASSAERR,"Socket::read() error!\n"));
b_.m_state = xdrIOBuffer::error;
}
#else
if (errno != EWOULDBLOCK) {
EL((ASSAERR,"Socket::read() error!\n"));
b_.m_state = xdrIOBuffer::error;
}
#endif
else {
EL((ASSAERR,"Socket::read() error! \n"));
}
return s_;
}
b_.m_ptr += ret;
DL((XDRBUFTRACE,"Received %d bytes\n", ret));
b_.dump ();
if (b_.m_sz == b_.size ()) { // at the end
DL((XDRBUFTRACE,"Complete message is in the buffer!\n"));
b_.m_state = xdrIOBuffer::xmitted;
b_.m_ptr = b_.m_buf; // rewind m_ptr for parsing stage
b_.dump ();
}
return s_;
}
EL
#define EL(X)
A macro for writing error message to the Logger.
Definition Logger.h:285
ASSA::AutoPtrRef::m_ptr
R * m_ptr
Definition AutoPtr.h:36
ASSA::xdrIOBuffer::waiting
@ waiting
Definition xdrIOBuffer.h:61
ASSA::xdrIOBuffer::xmitted
@ xmitted
Definition xdrIOBuffer.h:62
ASSA::xdrIOBuffer::error
@ error
Definition xdrIOBuffer.h:64

## set_errno()

void ASSA::set_errno | ( | int | new_errno_ | ) |

inline

Set error number in a portable way.

Definition at line 128 of file Logger_Impl.h.

{
#if defined (WIN32)
WSASetLastError (new_errno_);
#else
errno = new_errno_;
#endif
}

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().