acceptIncoming |
public:
DSNetwork * acceptIncoming (void);
Accept an incoming connection onto a fresh network connection.
connectToHost |
public:
BOOL connectToHost ( char * host, unsigned short nPort );
Connect to the specified hostname. It can process hostnames in the form hostname:port. Note that this function uses gethostbyname to resolve hostnames, and is therefore not threadsafe. You should protect accesses to this function via mutexes, and ensure that gethostbyname is either not used elsewhere or is protected with the same locks.
- host
- The name of the host to connect to, can include :port syntax.
- nPort
- The port to connect to, if no port is specified with the hostname.
getChar |
public:
BOOL getChar ( char * ch );
Retrieves a single incoming character.
- ch
- Specifies where to place the character.
getChar |
public:
BOOL getChar ( unsigned char * ch );
Retrieves a single incoming character.
- ch
- Specifies where to place the character.
getLineFromSocket |
public:
BOOLX getLineFromSocket ( char * buffer, int size );
Retrieves an incoming line from the network, if it's there.
- buffer
- Specifies the buffer where the line will be copied to.
- size
- Specifies the maximum size of the buffer.
getLineFromSocketWait |
public:
BOOL getLineFromSocketWait ( char * buffer, int size );
Retrieves an incoming line from the network, and wait till it arrives.
- buffer
- Specifies the buffer where the line will be copied to.
- size
- Specifies the maximum size of the buffer.
getSlab |
public:
BOOL getSlab ( char * buffer, int nSize );
Retrieves an incoming pile of data from the network, and wait till it arrives.
- buffer
- Specifies the buffer where the line will be copied to.
- nSize
- Specifies the size to be read.
getSocket |
public:
SOCKET getSocket (void);
Retrieves the socket used for low-level operations. Use this with great care. Specifically, only use this only if you need it.
linger |
public:
BOOL linger (void);
Switches the network into 'Linger' mode where all remaining data is sent out before a connection is really closed.
sendData |
public:
BOOL sendData ( const char * szData, int nSize=-1 );
Sends a pile of data into the Network.
- szData
- The data to send to the Network.
- nSize
- The size of the data being sent to the Network; if ommitted, the data will be assumed to be a NULL-terminated string and length determined accordingly.
startServer |
public:
BOOL startServer ( unsigned short nPort, unsigned long nIP=0 );
Starts the server listening for incoming connections to 1452.
- nPort
- The port that the server should listen on.
- nIP
- The IP address to listen on. If ommitted, will listen on all IP addresses.
terminate |
public:
BOOL terminate (void);
Closes this Network connection.
waitForData |
public:
BOOL waitForData ( int sec, int usec );
Waits for data to arrive on the connection, either indefinitely or for a period of time, returning TRUE if there is data available to be read.
- sec
- The number of seconds to wait for. If this value is negative, wait indefinitely.
- usec
- The number of microseconds to wait for. This value is ignored if sec is negative.
waitForDataEx |
public:
BOOLX waitForDataEx ( int sec, int usec );
Waits for data to arrive on the connection, either indefinitely or for a period of time, returning YES if there is data available to be read, NOTYET if there is no data currently, and NO if an error has occurred on the connection.
- sec
- The number of seconds to wait for. If this value is negative, wait indefinitely.
- usec
- The number of microseconds to wait for. This value is ignored if sec is negative.
(Last Updated 9/24/2004)