28 #ifndef AsyncComm_Event_h
29 #define AsyncComm_Event_h
150 strcpy((
char *)
proxy, p.c_str());
232 #endif // AsyncComm_Event_h
void display()
Displays a one-line string representation of the event to stdout.
Network communication event.
CommHeader header
Comm layer header for MESSAGE events.
void set_proxy(const String &p)
Sets the address proxy name from which this event was generated.
std::string String
A String is simply a typedef to std::string.
chrono::time_point< fast_clock > time_point
const char * proxy
Address proxy name.
char proxy_buf_static[32]
Static proxy name buffer.
char * proxy_buf
Pointer to allocated proxy name buffer.
std::shared_ptr< Event > EventPtr
Smart pointer to Event.
Event(Type type_, const sockaddr_in &addr_, const String &proxy_, int error_=Error::OK)
Constructor initializing with InetAddr and proxy name.
size_t payload_len
Length of the message.
Connection established event.
uint64_t group_id
Thread group to which this message belongs.
const uint8_t * payload
Points to a buffer containing the message payload.
InetAddr local_addr
Local address to which event was delivered.
InetAddr addr
Remote address from which event was generated.
Event(Type type_, int error_=Error::OK)
Constructor initializing with empty address.
Event(Type type_, const String &proxy_, int error_=0)
Constructor initialized with proxy name.
Encapsulate an internet address.
ClockT::time_point deadline()
Deadline for request.
Logging routines and macros.
Type
Enumeration for event types.
Event(Type type_, const InetAddr &addr_, int error_=Error::OK)
Constructor initializing with InetAddr.
Connection disconnected event.
Time related declarations.
void load_message_header(const uint8_t *buf, size_t len)
Loads header object from serialized message buffer.
int error
Error code associated with this event.
ClockT::time_point arrival_time
time (seconds since epoch) when message arrived
Internet address wrapper classes and utility functions.
Request/response message event.
String to_str() const
Generates a one-line string representation of the event.
A String class based on std::string.
Error codes, Exception handling, error logging.
bool payload_aligned
Flag indicating if payload was allocated with posix_memalign.