Network communication event.
More...
#include <Event.h>
Network communication event.
Objects of this type get passed up to the application through dispatch handlers (see DispatchHandler).
Definition at line 54 of file Event.h.
Constructor initializing with InetAddr.
- Parameters
-
type_ | Type of event |
addr_ | Remote address from which event originated |
error_ | Error code associated with this event |
Definition at line 74 of file Event.h.
Hypertable::Event::Event |
( |
Type |
type_, |
|
|
const sockaddr_in & |
addr_, |
|
|
const String & |
proxy_, |
|
|
int |
error_ = Error::OK |
|
) |
| |
|
inline |
Constructor initializing with InetAddr and proxy name.
- Parameters
-
type_ | Type of event |
addr_ | Remote address from which event originated |
proxy_ | Proxy name |
error_ | Error code associated with this event |
Definition at line 86 of file Event.h.
Constructor initializing with empty address.
- Parameters
-
type_ | Type of event |
error_ | Error code associated with this event |
Definition at line 97 of file Event.h.
Hypertable::Event::Event |
( |
Type |
type_, |
|
|
const String & |
proxy_, |
|
|
int |
error_ = 0 |
|
) |
| |
|
inline |
Constructor initialized with proxy name.
- Parameters
-
type_ | Type of event |
proxy_ | Proxy name |
error_ | Error code associated with this event |
Definition at line 108 of file Event.h.
Hypertable::Event::~Event |
( |
| ) |
|
|
inline |
Destructor.
Deallocates message payload buffer and proxy name buffer
Definition at line 115 of file Event.h.
Deadline for request.
- Returns
- Absolute deadline
Definition at line 157 of file Event.h.
void Hypertable::Event::display |
( |
| ) |
|
|
inline |
Displays a one-line string representation of the event to stdout.
- See also
- to_str
Definition at line 224 of file Event.h.
void Hypertable::Event::load_message_header |
( |
const uint8_t * |
buf, |
|
|
size_t |
len |
|
) |
| |
|
inline |
Loads header object from serialized message buffer.
This method also sets the group_id member.
- Parameters
-
buf | Buffer containing serialized header |
len | Length of buffer |
Definition at line 130 of file Event.h.
void Hypertable::Event::set_proxy |
( |
const String & |
p | ) |
|
|
inline |
Sets the address proxy name from which this event was generated.
If the proxy name is less than 32 characters, then it is copied into proxy_buf_static, otherwise a buffer is allocated to hold it. proxy is set to point to whichever buffer is chosen.
Definition at line 140 of file Event.h.
String Event::to_str |
( |
| ) |
const |
Generates a one-line string representation of the event.
For example:
Event: type=MESSAGE id=2 gid=0 header_len=16 total_len=20 \
from=127.0.0.1:15861 ...
Definition at line 48 of file Event.cc.
Remote address from which event was generated.
Definition at line 168 of file Event.h.
time (seconds since epoch) when message arrived
Definition at line 208 of file Event.h.
int Hypertable::Event::error {} |
Error code associated with this event.
DISCONNECT and ERROR events set this value
Definition at line 185 of file Event.h.
uint64_t Hypertable::Event::group_id {} |
Thread group to which this message belongs.
Used to serialize messages destined for the same object. This value is created in the constructor and is the combination of the socked descriptor from which the message was read and the gid field in the message header:
group_id = ((uint64_t)sd << 32) | header->gid;
If the gid is zero, then the group_id member is also set to zero
Definition at line 205 of file Event.h.
Comm layer header for MESSAGE events.
Definition at line 188 of file Event.h.
Local address to which event was delivered.
Definition at line 180 of file Event.h.
const uint8_t* Hypertable::Event::payload {} |
Points to a buffer containing the message payload.
Definition at line 191 of file Event.h.
bool Hypertable::Event::payload_aligned {} |
Flag indicating if payload was allocated with posix_memalign.
Definition at line 211 of file Event.h.
size_t Hypertable::Event::payload_len {} |
Length of the message.
Definition at line 194 of file Event.h.
const char* Hypertable::Event::proxy |
Address proxy name.
Definition at line 171 of file Event.h.
char* Hypertable::Event::proxy_buf {} |
Pointer to allocated proxy name buffer.
Definition at line 174 of file Event.h.
char Hypertable::Event::proxy_buf_static[32] |
Static proxy name buffer.
Definition at line 177 of file Event.h.
Type Hypertable::Event::type |
Type of event.
Can take one of values CONNECTION_ESTABLISHED, DISCONNECT, MESSAGE, ERROR, or TIMER
Definition at line 165 of file Event.h.
The documentation for this class was generated from the following files:
- /home/doug/src/hypertable/src/cc/AsyncComm/Event.h
- /home/doug/src/hypertable/src/cc/AsyncComm/Event.cc