DSNetwork


Discussion

DSNetwork.h aims to provide a simple, consistent, abstracted Network library which can operate equally on *nix and Win32. It includes the Network class (which is probably what you're looking for) and a whole pile of declarations to provide cross-platform consistency.

Constants


INVALID_SOCKET


const SOCKET INVALID_SOCKET = -1;
Discussion

Create an INVALID_SOCKET for platform abstraction.

Typedefs


HOSTENT


typedef struct hostent HOSTENT;
Discussion

Create an alias to struct hostent for platform abstraction.


SOCKADDR


typedef struct sockaddr SOCKADDR;
Discussion

Create an alias to struct sockaddr for platform abstraction.


SOCKADDR_IN


typedef struct sockaddr_in SOCKADDR_IN;
Discussion

Create an alias to struct sockaddr_in for platform abstraction.


SOCKET


typedef int SOCKET;
Discussion

Create an alias to int for platform abstraction.

Enumerations


BOOLX


typedef enum
{ NO, YES, NOTYET }
Discussion

In networking, it is possible for operations not to either succeed or fail, but for them to be not ready to complete just yet. This is a tri-state type to convey success, failure, and pending.

Constants

NO
The operation has failed.
YES
The operation has succeeded.
NOTYET
The operation can't succeed yet, may never succeed, may fail, but hasn't failed yet.

#defines


closesocket


#define closesocket(x) close(x)
Discussion

Create an alias to close for platform abstraction.


sleep


#define sleep(x) Sleep(x*1000)
Discussion

Create an alias to Sleep for platform abstraction.

(Last Updated 9/24/2004)