Starshatter_Open
Open source Starshatter engine
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
NetSock Class Reference

#include <NetSock.h>

List of all members.

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)
NetSockaccept (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 ()

Detailed Description

Definition at line 26 of file NetSock.h.


Member Enumeration Documentation

Enumerator:
SELECT_READ 
SELECT_WRITE 

Definition at line 31 of file NetSock.h.


Constructor & Destructor Documentation

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.


Member Function Documentation

NetSock * NetSock::accept ( NetAddr addr = 0)

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.

bool NetSock::is_closed ( ) const
inline

Definition at line 59 of file NetSock.h.

bool NetSock::is_stream ( ) const
inline

Definition at line 58 of file NetSock.h.

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.

Text NetSock::recvfrom ( NetAddr a = 0)

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.

int NetSock::sendto ( Text  msg,
const NetAddr dest 
)

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.

int NetSock::status ( ) const
inline

Definition at line 60 of file NetSock.h.

static const char* NetSock::TYPENAME ( )
inlinestatic

Definition at line 29 of file NetSock.h.


The documentation for this class was generated from the following files: