Starshatter_Open
Open source Starshatter engine
|
#include <NetSock.h>
Public Types | |
enum | SELECT_TYPE { SELECT_READ = 1, SELECT_WRITE = 2 } |
Public Member Functions | |
NetSock (bool stream=false) | |
NetSock (const NetAddr &addr, bool stream=false) | |
~NetSock () | |
int | bind (const NetAddr &addr) |
int | connect (const NetAddr &addr) |
int | listen (int max_connections=5) |
NetSock * | accept (NetAddr *addr=0) |
int | available () |
int | send (Text msg) |
Text | recv () |
int | sendto (Text msg, const NetAddr &dest) |
Text | recvfrom (NetAddr *a=0) |
int | select (SELECT_TYPE t=SELECT_READ, long seconds=0, long microseconds=0) |
int | shutdown_input () |
int | shutdown_output () |
int | set_timeout (int msecs) |
int | close () |
DWORD | max_packet_size () const |
bool | is_stream () const |
bool | is_closed () const |
int | status () const |
Static Public Member Functions | |
static const char * | TYPENAME () |
enum NetSock::SELECT_TYPE |
NetSock::NetSock | ( | bool | str = false | ) |
Server-side socket constructor
Definition at line 28 of file NetSock.cpp.
NetSock::NetSock | ( | const NetAddr & | addr, |
bool | str = false |
||
) |
Client-side socket constructor
Will connect to server at "addr"
Definition at line 52 of file NetSock.cpp.
NetSock::~NetSock | ( | ) |
Definition at line 63 of file NetSock.cpp.
Definition at line 92 of file NetSock.cpp.
int NetSock::available | ( | ) |
Definition at line 121 of file NetSock.cpp.
int NetSock::bind | ( | const NetAddr & | addr | ) |
Definition at line 71 of file NetSock.cpp.
int NetSock::close | ( | ) |
Definition at line 319 of file NetSock.cpp.
int NetSock::connect | ( | const NetAddr & | addr | ) |
Definition at line 78 of file NetSock.cpp.
int NetSock::listen | ( | int | max_connections = 5 | ) |
Definition at line 85 of file NetSock.cpp.
DWORD NetSock::max_packet_size | ( | ) | const |
Definition at line 334 of file NetSock.cpp.
Text NetSock::recv | ( | ) |
Definition at line 142 of file NetSock.cpp.
Definition at line 197 of file NetSock.cpp.
int NetSock::select | ( | SELECT_TYPE | t = SELECT_READ , |
long | seconds = 0 , |
||
long | microseconds = 0 |
||
) |
Definition at line 228 of file NetSock.cpp.
int NetSock::send | ( | Text | msg | ) |
Definition at line 135 of file NetSock.cpp.
Definition at line 189 of file NetSock.cpp.
int NetSock::set_timeout | ( | int | msecs | ) |
Definition at line 254 of file NetSock.cpp.
int NetSock::shutdown_input | ( | ) |
Definition at line 299 of file NetSock.cpp.
int NetSock::shutdown_output | ( | ) |
Definition at line 309 of file NetSock.cpp.