Home / Open source / Terimber 2.0
msg_sock_listener Class Referenceclass implements the socket listener that supports both types of connection
More...
#include <msg_sock.h>
List of all members.
|
Public Member Functions |
| msg_sock_listener (msg_communicator *communicator, const conf_listener &info) |
| costructor
|
virtual | ~msg_sock_listener () |
| destructor
|
virtual transport_type | get_type () const |
| returns the sock listener type
|
Protected Member Functions |
virtual void | v_on () |
| action on turn on
|
virtual void | v_off () |
| action on turn off
|
virtual void | v_on_error (size_t handle, int err, aiosock_type mask, void *userdata) |
| port will call function after error occured
|
virtual void | v_on_connect (size_t handle, const sockaddr_in &peeraddr, void *userdata) |
| port will call function after successfully connecting to socket
|
virtual void | v_on_send (size_t handle, void *buf, size_t requested, size_t processed, const sockaddr_in &peeraddr, void *userdata) |
| port will call function after successfully sending buffer to socket
|
virtual void | v_on_receive (size_t handle, void *buf, size_t requested, size_t processed, const sockaddr_in &peeraddr, void *userdata) |
| port will call function after successfully receiving buffer from socket
|
virtual void | v_on_accept (size_t handle, size_t handle_accepted, terimber_aiosock_callback *&callback, const sockaddr_in &peeraddr, void *userdata) |
| port will call function after successfully accepting the new incoming connection user can change the callback, by default it's an object which created a listener
|
Private Attributes |
size_t | _handle |
| socket handle
|
Detailed Description
class implements the socket listener that supports both types of connection
Definition at line 149 of file msg_sock.h.
Constructor & Destructor Documentation
costructor
- Parameters:
-
communicator |
communicator pointer |
info |
listener info |
Definition at line 444 of file msg_sock.cpp.
msg_sock_listener::~msg_sock_listener |
( |
|
) |
[virtual] |
Member Function Documentation
virtual transport_type msg_sock_listener::get_type |
( |
|
) |
const [inline, virtual] |
void msg_sock_listener::v_on |
( |
|
) |
[protected, virtual] |
action on turn on
overrides the activate/deactivate functions
Reimplemented from msg_base.
Definition at line 461 of file msg_sock.cpp.
References msg_base::_communicator, conf_listener::_connections, _handle, msg_listener::_info, conf_listener::_network, conf_listener::_port, exception::_throw(), aiosock::create(), msg_communicator::get_aiosock(), msg_base::is_on(), aiosock::listen(), sockStatus(), and msg_base::v_on().
void msg_sock_listener::v_off |
( |
|
) |
[protected, virtual] |
void msg_sock_listener::v_on_error |
( |
size_t |
handle, |
|
|
int |
err, |
|
|
aiosock_type |
mask, |
|
|
void * |
userdata | |
|
) |
| | [protected, virtual] |
port will call function after error occured
aio callbacks - Parameters:
-
handle |
socket handle |
err |
error code |
mask |
reason |
userdata |
user defined data |
Implements terimber_aiosock_callback.
Definition at line 496 of file msg_sock.cpp.
References _handle.
void msg_sock_listener::v_on_connect |
( |
size_t |
handle, |
|
|
const sockaddr_in & |
peeraddr, |
|
|
void * |
userdata | |
|
) |
| | [protected, virtual] |
port will call function after successfully connecting to socket
- Parameters:
-
handle |
socket handle |
peeraddr |
peer address |
userdata |
user defined data |
Implements terimber_aiosock_callback.
Definition at line 504 of file msg_sock.cpp.
void msg_sock_listener::v_on_send |
( |
size_t |
handle, |
|
|
void * |
buf, |
|
|
size_t |
requested, |
|
|
size_t |
processed, |
|
|
const sockaddr_in & |
peeraddr, |
|
|
void * |
userdata | |
|
) |
| | [protected, virtual] |
port will call function after successfully sending buffer to socket
- Parameters:
-
handle |
socket handle |
buf |
buffer |
requested |
requested bytes to send |
processed |
actually porcessed bytes |
peeraddr |
peer address |
userdata |
user defined data |
Implements terimber_aiosock_callback.
Definition at line 512 of file msg_sock.cpp.
void msg_sock_listener::v_on_receive |
( |
size_t |
handle, |
|
|
void * |
buf, |
|
|
size_t |
requested, |
|
|
size_t |
processed, |
|
|
const sockaddr_in & |
peeraddr, |
|
|
void * |
userdata | |
|
) |
| | [protected, virtual] |
port will call function after successfully receiving buffer from socket
- Parameters:
-
handle |
socket handle |
buf |
buffer |
requested |
requested bytes to receive |
processed |
actually processed bytes |
peeraddr |
peer address |
userdata |
user defined data |
Implements terimber_aiosock_callback.
Definition at line 520 of file msg_sock.cpp.
void msg_sock_listener::v_on_accept |
( |
size_t |
handle, |
|
|
size_t |
handle_accepted, |
|
|
terimber_aiosock_callback *& |
callback, |
|
|
const sockaddr_in & |
peeraddr, |
|
|
void * |
userdata | |
|
) |
| | [protected, virtual] |
Member Data Documentation
The documentation for this class was generated from the following files:
|
|