VG3_nw_connect()
Connect to network-server.SYNTAX
int
VG3_nw_connect(struct vg3_nwclient *nwclnt,
const char *ipaddr,
const char *svport,
const char *name,
int maxcli,
int *masterbyte)
FUNCTION PARAMETERS
nwclnt | Network-struct |
ipaddr | IP address of network-server |
svport | UDP port of network-server or NULL = default port |
name | Name of client for identification or NULL = hostname |
maxcli | Maximal number of clients to connect or 0 = no matter |
masterbyte | Whether client is master-client: 0 = no master, 1 to 255 = master There must be exactly one master. Only the master can stop waiting for connnections and start the game. The value of the masterbyte will be sent to all clients, this is a rudimentary way to pass settings to the clients. When the game has begun, the master becomes irrelevant. |
RETURN VALUE
Returns the client-number on success,
or 0 on exiting-request: close window and exit the game
or -1 on failure.
ERRORS
On error VG3_errmsg() returns:
EINVAL - error in argument
ENOTCONN - cannot connect to network-server
EIO - error sending to or receiving from network-server
DESCRIPTION
Connect to the network-server.
Before connecting the keys have to be defined with VG3_nw_addkey().
SEE ALSO