Base functionality for a TCP connected socket This class is pretty useless by itself but it does hide some of the platform differences from machine to machine.
More...
#include "socket_tcp.h"
List of all members.
Public Member Functions |
|
| Socket_TCP (SOCKET) |
| bool | ActiveOpen (const Socket_Address &theaddress, bool setdelay) |
| | This function will try and set the socket up for active open to a specified address and port provided by the input parameter.
|
| bool | ActiveOpenNonBlocking (const Socket_Address &theaddress) |
| | This function will try and set the socket up for active open to a specified address and port provided by the input parameter (non-blocking version)
|
| int | DontLinger () |
| | Turn off the linger flag.
|
|
bool | ErrorIs_WouldBlocking (int err) |
|
virtual TypeHandle | force_init_type () |
|
virtual TypeHandle | get_type () const |
| std::string | RecvData (int max_len) |
| | Read the data from the connection.
|
| int | RecvData (char *data, int size) |
| | Read the data from the connection.
|
| int | SendData (const char *data, int size) |
| | Ok Lets Send the Data.
|
|
int | SendData (const std::string &str) |
| int | SetLinger (int interval_seconds=0) |
| | will control the behavior of SO_LINGER for a TCP socket
|
| int | SetNoDelay (bool flag=true) |
| | Disable Nagle algorithm.
|
| int | SetSendBufferSize (int insize) |
| | Just like it sounds.
|
|
bool | ShutdownSend () |
Static Public Member Functions |
|
static TypeHandle | get_class_type () |
| static void | init_type () |
| | This function is declared non-inline to work around a compiler bug in g++ 2.96.
|
Detailed Description
Base functionality for a TCP connected socket This class is pretty useless by itself but it does hide some of the platform differences from machine to machine.
Definition at line 15 of file socket_tcp.h.
Member Function Documentation
| bool Socket_TCP::ActiveOpen |
( |
const Socket_Address & |
theaddress, |
|
|
bool |
setdelay |
|
) |
| [inline] |
This function will try and set the socket up for active open to a specified address and port provided by the input parameter.
Definition at line 131 of file socket_tcp.h.
References SetNoDelay().
| bool Socket_TCP::ActiveOpenNonBlocking |
( |
const Socket_Address & |
theaddress | ) |
[inline] |
| int Socket_TCP::DontLinger |
( |
| ) |
[inline] |
Turn off the linger flag.
The socket will quickly release buffered items and free up OS resources. You may lose a stream if you use this flag and do not negotiate the close at the application layer.
Definition at line 102 of file socket_tcp.h.
Referenced by Connection::set_linger().
| static void Socket_TCP::init_type |
( |
| ) |
[inline, static] |
| int Socket_TCP::RecvData |
( |
char * |
data, |
|
|
int |
len |
|
) |
| [inline] |
Read the data from the connection.
Return type : int
- if error 0 if socket closed for read or length is 0 + bytes read ( May be smaller than requested)
Definition at line 195 of file socket_tcp.h.
| std::string Socket_TCP::RecvData |
( |
int |
max_len | ) |
[inline] |
Read the data from the connection.
Return type : int
- if error 0 if socket closed for read or length is 0 + bytes read ( May be smaller than requested)
Definition at line 210 of file socket_tcp.h.
| int Socket_TCP::SendData |
( |
const char * |
data, |
|
|
int |
size |
|
) |
| [inline] |
Ok Lets Send the Data.
Return type : int
- if error 0 if socket closed for write or lengh is 0 + bytes writen ( May be smaller than requested)
Definition at line 181 of file socket_tcp.h.
| int Socket_TCP::SetLinger |
( |
int |
interval_seconds = 0 | ) |
[inline] |
| int Socket_TCP::SetNoDelay |
( |
bool |
flag = true | ) |
[inline] |
| int Socket_TCP::SetSendBufferSize |
( |
int |
insize | ) |
[inline] |
The documentation for this class was generated from the following files: