|
|
|
|
|
|
Home / Open source / Terimber 2.0
terimber_aiosock Class Referenceabstract interface for the socket port
More...
#include <aiosockfactory.h>
List of all members.
|
Public Member Functions |
| virtual | ~terimber_aiosock () |
| | destructor
|
| virtual size_t | create (terimber_aiosock_callback *callback, bool tcp_udp)=0 |
| | create TCP socket
|
| virtual void | close (size_t handle)=0 |
| | close socket
|
| virtual int | send (size_t handle, const void *buf, size_t len, size_t timeout, const sockaddr_in *toaddr, void *userdata)=0 |
| | sends buffer to specified socket asynchronously
|
| virtual int | receive (size_t handle, void *buf, size_t len, size_t timeout, const sockaddr_in *fromaddr, void *userdata)=0 |
| | receives buffer of bytes from specified socket asynchronously
|
| virtual int | connect (size_t handle, const char *address, unsigned short port, size_t timeout, void *userdata)=0 |
| | connects to the specified socket synchronously
|
| virtual int | listen (size_t handle, unsigned short port, size_t max_connection, const char *address, unsigned short accept_pool, void *userdata)=0 |
| | turns the specified socket to the listening state and will automatically accept incoming connections asynchronously address can be null in case of local host
|
| virtual int | getpeeraddr (size_t handle, sockaddr_in &addr)=0 |
| | gets the peer address
|
| virtual int | bind (size_t handle, const char *address, unsigned short port)=0 |
| | binds to the specified socket address
|
| virtual int | getsockaddr (size_t handle, sockaddr_in &addr)=0 |
| | gets the sock address
|
| virtual bool | get_error_description (int err, char *buf, size_t len) const =0 |
| | gets error string by code
|
| virtual void | doxray ()=0 |
| | makes the snapshot of internal state
|
Detailed Description
abstract interface for the socket port
Definition at line 101 of file aiosockfactory.h.
Constructor & Destructor Documentation
| virtual terimber_aiosock::~terimber_aiosock |
( |
|
) |
[inline, virtual] |
Member Function Documentation
create TCP socket
- Parameters:
-
| callback |
callback for processing asynchronous actions |
| tcp_udp |
type of socket TCP/UDP |
Implemented in aiosock.
| virtual void terimber_aiosock::close |
( |
size_t |
handle |
) |
[pure virtual] |
close socket
- Parameters:
-
Implemented in aiosock.
| virtual int terimber_aiosock::send |
( |
size_t |
handle, |
|
|
const void * |
buf, |
|
|
size_t |
len, |
|
|
size_t |
timeout, |
|
|
const sockaddr_in * |
toaddr, |
|
|
void * |
userdata | |
|
) |
| | [pure virtual] |
sends buffer to specified socket asynchronously
- Parameters:
-
| handle |
socket handle |
| buf |
buffer to send |
| len |
buffer length |
| timeout |
timeout in milliseconds |
| toaddr |
peer address, optional for TCP sockets |
| userdata |
user defined data |
Implemented in aiosock.
| virtual int terimber_aiosock::receive |
( |
size_t |
handle, |
|
|
void * |
buf, |
|
|
size_t |
len, |
|
|
size_t |
timeout, |
|
|
const sockaddr_in * |
fromaddr, |
|
|
void * |
userdata | |
|
) |
| | [pure virtual] |
receives buffer of bytes from specified socket asynchronously
- Parameters:
-
| handle |
socket handle |
| buf |
buffer to receive |
| len |
buffer length |
| timeout |
timeout in milliseconds |
| fromaddr |
peer address, optional for TCP sockets |
| userdata |
user defined data |
Implemented in aiosock.
| virtual int terimber_aiosock::connect |
( |
size_t |
handle, |
|
|
const char * |
address, |
|
|
unsigned short |
port, |
|
|
size_t |
timeout, |
|
|
void * |
userdata | |
|
) |
| | [pure virtual] |
connects to the specified socket synchronously
- Parameters:
-
| handle |
socket handle |
| address |
address (computer IP or DNS name) |
| port |
port |
| timeout |
timeout in milliseconds |
| userdata |
user defined data |
Implemented in aiosock.
| virtual int terimber_aiosock::listen |
( |
size_t |
handle, |
|
|
unsigned short |
port, |
|
|
size_t |
max_connection, |
|
|
const char * |
address, |
|
|
unsigned short |
accept_pool, |
|
|
void * |
userdata | |
|
) |
| | [pure virtual] |
turns the specified socket to the listening state and will automatically accept incoming connections asynchronously address can be null in case of local host
- Parameters:
-
| handle |
socket handle |
| port |
listening port |
| max_connection |
max connections waiting for accept |
| address |
listener address: IP address, DSN name, localhost |
| accept_pool |
max active acceptors waiting for incoming connections |
| userdata |
user defined data |
Implemented in aiosock.
| virtual int terimber_aiosock::getpeeraddr |
( |
size_t |
handle, |
|
|
sockaddr_in & |
addr | |
|
) |
| | [pure virtual] |
gets the peer address
- Parameters:
-
| handle |
socket handle |
| addr |
peer address |
Implemented in aiosock.
| virtual int terimber_aiosock::bind |
( |
size_t |
handle, |
|
|
const char * |
address, |
|
|
unsigned short |
port | |
|
) |
| | [pure virtual] |
binds to the specified socket address
- Parameters:
-
| handle |
socket handle |
| address |
address: IP address, DSN name, localhost |
| port |
port |
Implemented in aiosock.
| virtual int terimber_aiosock::getsockaddr |
( |
size_t |
handle, |
|
|
sockaddr_in & |
addr | |
|
) |
| | [pure virtual] |
gets the sock address
- Parameters:
-
| handle |
socket handle |
| addr |
this socket address |
Implemented in aiosock.
| virtual bool terimber_aiosock::get_error_description |
( |
int |
err, |
|
|
char * |
buf, |
|
|
size_t |
len | |
|
) |
| | const [pure virtual] |
gets error string by code
- Parameters:
-
| err |
error code |
| buf |
[in, out] buffer |
| len |
buffer length |
Implemented in aiosock.
| virtual void terimber_aiosock::doxray |
( |
|
) |
[pure virtual] |
makes the snapshot of internal state
Implemented in aiosock.
The documentation for this class was generated from the following file:
|
|
|
|