|
|
|
Home / Open source / Terimber 2.0
terimber_socket Class Referencesocket class for xml http streams
More...
#include <socket.h>
List of all members.
|
Public Member Functions |
| terimber_socket (int num=(int) INVALID_SOCKET) |
| constructor
|
| ~terimber_socket () |
| destructor
|
bool | close () |
| closes and destroys terimber_socket
|
bool | connect () |
| opens and connects terimber_socket to the previously set address
|
int | send (const char *data, size_t len, size_t &timeout) |
| sends known length data to destination while timeout
|
int | receive (char *data, size_t len, size_t &timeout) |
| receives known length data from source while timeout
|
int | receive_whatever (char *data, size_t len, size_t &timeout, size_t &rlen) |
| receives unknown length data from source while timeout
|
const sockaddr_in & | get_address () const |
| returns address
|
void | set_address (const sockaddr_in &addr) |
| sets address
|
int | set_invalid () |
| invalidates socket
|
bool | is_invalid () const |
| checks socket validity
|
Static Public Member Functions |
static void | set_options (int number) |
| sets options
|
static int | resolve_address (const char *str, ub2_t port, sockaddr_in &addr) |
| resolves string address
|
static void | set_send_timeout (int number, size_t timeout) |
| sets send timeout
|
static void | set_recv_timeout (int number, size_t timeout) |
| sets receive timeout
|
Private Attributes |
SOCKET | _number |
| socket handle
|
sockaddr_in | _addr |
| socket address
|
Detailed Description
socket class for xml http streams
Definition at line 39 of file socket.h.
Constructor & Destructor Documentation
BEGIN_TERIMBER_NAMESPACE terimber_socket::terimber_socket |
( |
int |
num = (int)INVALID_SOCKET |
) |
|
constructor
For VC7, and VC8. - Parameters:
-
Definition at line 44 of file socket.cpp.
References _addr.
terimber_socket::~terimber_socket |
( |
|
) |
|
Member Function Documentation
bool terimber_socket::close |
( |
|
) |
|
bool terimber_socket::connect |
( |
|
) |
|
int terimber_socket::send |
( |
const char * |
data, |
|
|
size_t |
len, |
|
|
size_t & |
timeout | |
|
) |
| | |
sends known length data to destination while timeout
- Parameters:
-
data |
buffer |
len |
buffer length |
timeout |
[in,out] timeout in milliseconds |
Definition at line 254 of file socket.cpp.
References _number.
Referenced by stream_input_common::open().
int terimber_socket::receive |
( |
char * |
data, |
|
|
size_t |
len, |
|
|
size_t & |
timeout | |
|
) |
| | |
int terimber_socket::receive_whatever |
( |
char * |
data, |
|
|
size_t |
len, |
|
|
size_t & |
timeout, |
|
|
size_t & |
rlen | |
|
) |
| | |
receives unknown length data from source while timeout
- Parameters:
-
data |
pre-allocated buffer |
len |
buffer length |
timeout |
[in,out] timeout in milliseconds |
rlen |
[out] received bytes |
Definition at line 374 of file socket.cpp.
References _number.
const sockaddr_in& terimber_socket::get_address |
( |
|
) |
const [inline] |
void terimber_socket::set_address |
( |
const sockaddr_in & |
addr |
) |
[inline] |
void terimber_socket::set_options |
( |
int |
number |
) |
[static] |
int terimber_socket::resolve_address |
( |
const char * |
str, |
|
|
ub2_t |
port, |
|
|
sockaddr_in & |
addr | |
|
) |
| | [static] |
void terimber_socket::set_send_timeout |
( |
int |
number, |
|
|
size_t |
timeout | |
|
) |
| | [static] |
sets send timeout
- Parameters:
-
number |
socket handle |
timeout |
timeout in milliseconds |
Definition at line 118 of file socket.cpp.
void terimber_socket::set_recv_timeout |
( |
int |
number, |
|
|
size_t |
timeout | |
|
) |
| | [static] |
sets receive timeout
- Parameters:
-
number |
socket handle |
timeout |
timeout in milliseconds |
Definition at line 149 of file socket.cpp.
int terimber_socket::set_invalid |
( |
|
) |
|
bool terimber_socket::is_invalid |
( |
|
) |
const |
Member Data Documentation
The documentation for this class was generated from the following files:
|
|
|
|