|
|
|
|
|
|
Home / Open source / Terimber 2.0
terimber_aiogate Class Referenceclass abstraction aiogate aiogate will provide this interface
More...
#include <aiogatefactory.h>
List of all members.
|
Public Member Functions |
| virtual | ~terimber_aiogate () |
| | destructor
|
| virtual size_t | listen (const char *address, unsigned short port, size_t max_connection, unsigned short buffered_acceptors, terimber_aiogate_pin_factory *factory, void *arg)=0 |
| | initiates listening on ip/port pin returns unique identificator for listener caller invokes function only once - aiogate will accept incoming connection automatically listen --> accept --> factory->create() --> pin->on_accept() -| |________________________________________________| until deaf function called all failed accepts ignored
|
| virtual void | deaf (size_t ident)=0 |
| | stops listener with specified ident
|
| virtual size_t | connect (const char *remote, unsigned short rport, const char *local, unsigned short lport, size_t timeout, terimber_aiogate_pin_factory *factory, void *arg)=0 |
| | initiate connection returns ident if asynchronous connection process has been initiated when asynchronous connection completed (failed or succeeded) connect --> factory->create() --> (pin->on_connect() OR pin->on_close())
|
| virtual size_t | bind (const char *address, unsigned short port, terimber_aiogate_pin_factory *factory, void *arg)=0 |
| | binds to the specified socket address
|
| virtual bool | send (size_t ident, const void *buf, size_t len, const sockaddr_in *toaddr)=0 |
| | sends buf bytes asynchronously caller does NOT need to keep a valid pointer to the buffer until the asynchronous operation is be completed aiogate will make a copy of sending bytes.
|
| virtual bool | send_bulk (size_t ident, const terimber_aiogate_buffer *bulk, size_t count, const sockaddr_in *toaddr)=0 |
| | same as above but can take the array of buffers
|
| virtual bool | recv (size_t ident, bool expect_delivery, const sockaddr_in *toaddr)=0 |
| | initiates receive process, either use the big buffer or just a small one in order to save the memory usage for a unknown waiting time
|
| virtual bool | close (size_t ident)=0 |
| | closes connection pin
|
| virtual bool | set_send_timeout (size_t ident, size_t timeout)=0 |
| | sets send timeout
|
| virtual bool | set_recv_timeout (size_t ident, size_t timeout)=0 |
| | sets recv timeout
|
| virtual void | doxray ()=0 |
| | makes the snapshot of internal state
|
Detailed Description
class abstraction aiogate aiogate will provide this interface
Definition at line 149 of file aiogatefactory.h.
Constructor & Destructor Documentation
| virtual terimber_aiogate::~terimber_aiogate |
( |
|
) |
[inline, virtual] |
Member Function Documentation
| virtual size_t terimber_aiogate::listen |
( |
const char * |
address, |
|
|
unsigned short |
port, |
|
|
size_t |
max_connection, |
|
|
unsigned short |
buffered_acceptors, |
|
|
terimber_aiogate_pin_factory * |
factory, |
|
|
void * |
arg | |
|
) |
| | [pure virtual] |
initiates listening on ip/port pin returns unique identificator for listener caller invokes function only once - aiogate will accept incoming connection automatically listen --> accept --> factory->create() --> pin->on_accept() -| |________________________________________________| until deaf function called all failed accepts ignored
- Parameters:
-
| address |
server ip or name, can be null - localhost will be used |
| port |
listening port |
| max_connection |
max waited connections |
| buffered_acceptors |
how many acceptors will be waiting for incoming pins |
| factory |
factory, which knows how to create pin |
| arg |
user defined argument - will be used for terimber_aiogate_pin_factory::create method as an input argument this is a way how to separate different sources of incoming socket connections |
Implemented in aiogate.
| virtual void terimber_aiogate::deaf |
( |
size_t |
ident |
) |
[pure virtual] |
stops listener with specified ident
- Parameters:
-
Implemented in aiogate.
| virtual size_t terimber_aiogate::connect |
( |
const char * |
remote, |
|
|
unsigned short |
rport, |
|
|
const char * |
local, |
|
|
unsigned short |
lport, |
|
|
size_t |
timeout, |
|
|
terimber_aiogate_pin_factory * |
factory, |
|
|
void * |
arg | |
|
) |
| | [pure virtual] |
initiate connection returns ident if asynchronous connection process has been initiated when asynchronous connection completed (failed or succeeded) connect --> factory->create() --> (pin->on_connect() OR pin->on_close())
- Parameters:
-
| remote |
remote host ip or name |
| rport |
remote port |
| local |
local host ip or name - optional can be null |
| lport |
local port - optional can be zero |
| timeout |
timeout in milliseconds |
| factory |
factory, which knows how to create pin |
| arg |
user defined argument - will be used for terimber_aiogate_pin_factory::create method as an input argument this is a way to separate different destinations of outgoing socket connections |
Implemented in aiogate.
| virtual size_t terimber_aiogate::bind |
( |
const char * |
address, |
|
|
unsigned short |
port, |
|
|
terimber_aiogate_pin_factory * |
factory, |
|
|
void * |
arg | |
|
) |
| | [pure virtual] |
binds to the specified socket address
- Parameters:
-
| address |
local host ip or name |
| port |
local port |
| factory |
factory, which knows how to create pin |
| arg |
user defined argument - will be used for terimber_aiogate_pin_factory::create method as an input argument |
Implemented in aiogate.
| virtual bool terimber_aiogate::send |
( |
size_t |
ident, |
|
|
const void * |
buf, |
|
|
size_t |
len, |
|
|
const sockaddr_in * |
toaddr | |
|
) |
| | [pure virtual] |
sends buf bytes asynchronously caller does NOT need to keep a valid pointer to the buffer until the asynchronous operation is be completed aiogate will make a copy of sending bytes.
- Parameters:
-
| ident |
unique pin identificator |
| buf |
buffer to send |
| len |
length of buffer |
| toaddr |
peer address, optional for UDP only |
Implemented in aiogate.
| virtual bool terimber_aiogate::send_bulk |
( |
size_t |
ident, |
|
|
const terimber_aiogate_buffer * |
bulk, |
|
|
size_t |
count, |
|
|
const sockaddr_in * |
toaddr | |
|
) |
| | [pure virtual] |
same as above but can take the array of buffers
- Parameters:
-
| ident |
unique pin identificator |
| bulk |
buffers to send |
| count |
length of bulk |
| toaddr |
peer address, optional for UDP only |
Implemented in aiogate.
| virtual bool terimber_aiogate::recv |
( |
size_t |
ident, |
|
|
bool |
expect_delivery, |
|
|
const sockaddr_in * |
toaddr | |
|
) |
| | [pure virtual] |
initiates receive process, either use the big buffer or just a small one in order to save the memory usage for a unknown waiting time
- Parameters:
-
| ident |
unique pin identificator |
| expect_delivery |
memory usage advisor |
| toaddr |
peer address, optional for UDP only |
Implemented in aiogate.
| virtual bool terimber_aiogate::close |
( |
size_t |
ident |
) |
[pure virtual] |
closes connection pin
- Parameters:
-
| ident |
unique pin identificator |
Implemented in aiogate.
| virtual bool terimber_aiogate::set_send_timeout |
( |
size_t |
ident, |
|
|
size_t |
timeout | |
|
) |
| | [pure virtual] |
sets send timeout
- Parameters:
-
| ident |
unique pin identificator |
| timeout |
timeout in milliseconds |
Implemented in aiogate.
| virtual bool terimber_aiogate::set_recv_timeout |
( |
size_t |
ident, |
|
|
size_t |
timeout | |
|
) |
| | [pure virtual] |
sets recv timeout
- Parameters:
-
| ident |
unique pin identificator |
| timeout |
timeout in milliseconds |
Implemented in aiogate.
| virtual void terimber_aiogate::doxray |
( |
|
) |
[pure virtual] |
makes the snapshot of internal state
Implemented in aiogate.
The documentation for this class was generated from the following file:
|
|
|
|