This wiki is out of date, use the continuation of this wiki instead

NET SendVar

From FenixWiki

Revision as of 19:53, 12 September 2007 by Sandman (Talk | contribs)
Jump to: navigation, search

Up to Network.DLL Functions



Contents

Definition

INT NET_SendVar ( <WORD connection> , <BYTE POINTER data> , <INT length> , [<BYTE includeseparator>] )

Sends data in array form or a byte, word or int or whatever other variable.

A null character on the end is not needed:

NET_SendVar( netid , &msg , sizeof(msg) );

Or send a struct:

NET_SendVar( netid , mystruct , sizeof(mystruct) );

Parameters

WORD connection - The connection identifier.
BYTE POINTER data - The pointer to the data/variable.
INT length - The length/size of the data/variable.
[BYTE includeseparator] - true/false: whether the connection's separator will be added to the data at the end. Default is true.

Returns

INT : The size of the succesfully sent data. With the separatorlength, if the separator was added.

NET_ERROR_INVALIDCONN - The connection is invalid.
NET_ERROR_CONNINACTIVE - The connection is inactive.
NET_ERROR_MESSAGETOOLONG - The message is too long.
NET_ERROR_SENDING - Could not send.
>=0 - The size of the succesfully sent data. With the separatorlength, if the separator was added.

Notes

Make sure the data is received properly. If you send a struct, be sure the receiver knows he should be receiving a struct and then receive the struct like it should. NET_RecvVar() is helpful for this.

Personal tools