- TCP

	NET_INIT ();
	Initialize NET functions. Returns 0 on succes, -1 on error.
	
	NET_QUIT ();
	Must be called to close NET functions. Returns 0.
	
	NET_RESOLVEHOST (int conn_numer, string host, int port);
	Prepares a connection. Host must be 0 if the program is to be a server. Returns 0 on success, -1 on failure.
	
	NET_RESOLVEHOST2 (int conn_number, int host, int port);
	Same as net_resolvehost but using an INT for host.
	
	NET_TCP_OPEN (int conn_number);
	Opens a prepared (see NET_RESOLVEHOST). Returns 0 on success, -1 on error.
	
	NET_TCP_CLOSE (int conn_number);
	Closes a previously open connection (see NET_TCP_OPEN). Returns 0.
	
	NET_TCP_ACCEPT (int conn_number);
	Accepts an incoming conecction previously opened (see NET_TCP_OPEN). Returns 0 on success, -1 on error.
	
	NET_TCP_GETPEERADDRESS (int conn_number);
	Get data from the other end for a given connection. Use NET_GET_HOST & NET_GET_PORT to check the results.
	
	NET_TCP_SEND (int conn_number, int pointer data, int length);
	Returns the bytecount for the sent data.  If this number is smaller than LENGTH there was an error while sending.	
	
	NET_TCP_RECV (int conn_number, int pointer data, int max_length);
	Returns the bytecount for the received data.  If this number is lower or equal to 0 there was an error while receiving.
	
	NET_GET_HOST (int conn_number);
	Returns IP from a given connection.  Normally used after NET_TCP_GETPEERADDRESS.
	
	NET_GET_PORT (int conn_number);
	Returns port number for a given connection.  Norammly used ager NET_TCP_GETPEERADDRESS.


- UDP PACKETS
	
	Fenix structs needed
	
		type _IPaddress
		    int host;
		    word port;
		end
	
		type _UDPpacket
		    int channel;       
		    byte pointer data;
		    int len;
		    int maxlen;
		    int status;
		    _IPaddress address;
		end

	NET_UDP_ALLOCPACKET (int pck_number, int size);
	Creates a new packet with a buffer of size SIZE.  Returns -1 if there was an error.
	
	NET_UDP_RESIZEPACKET (int pck_number, int new_size);
	Rellocates the buffer to the new size on the given packet.  Returns 0 on success, -1 on error.
	
	NET_UDP_FREEPACKET (int pck_number);
	Frees memory used by the given packet.  Returns 0.
	
	NET_UDP_ALLOCPACKETV (int vector_number, int packet_count, int size);
	Creates a packet array.  Returns 0 on success, -1 on error.
	
	NET_UDP_FREEPACKETV (int vector_number);
	Frees memory for a given packet array. Returns 0.
	
	NET_UDP_GETPACKET (int pck_number);
	Returns a pointer to an _UDPpacket struct for the given packet.
	
	NET_UDP_GETPACKETV (int vector_number);
	Returns a pointer pointer (** or array of pointers) to an _UPDpacket struct.

	
- UDP SOCKETS

	NET_UDP_OPEN (int sck_number, int port);
	Opens a socket to send or recive UDP packets.  Returns 0, -1 on error.
	
	NET_UDP_CLOSE (int sck_number);
	Closes a socket. Returns 0.
	
	NET_UDP_BIND (int sck_number, int chanel, string ip, int port);
	Assigns an ip address to a given chanel in a socket.  Returns channel number on success or -1 on error.
	
	NET_UDP_BIND2 (int sck_number, int chanel, int ip, int port);
	Same as NET_UDP_BIND but using an int as IP. 
	
	NET_UDP_UNBIND (int sck_number, int chanel);
	Removes adress assignations to a given chanel.  Returns 0.
	
	NET_UDP_GETPEERADDRESS (int sck_number, int chanel);
	Returns a pointer to an _IPaddress struct.
	
	NET_UDP_SEND (int sck_numbet, int chanel, int pck_size);
	Sends a given packet through a given channel in a socket. Return number of valid sends.

	NET_UDP_RECV (int sck_number, int pck_number);
	REceives a packet.  Return 1 if a packet was received, 0 if nothing was received.
	
	NET_UDP_SENDV (int sck_number, int vector_number, int pck_count);
	Sends a full packet array.  Return number of valid sends.
	
	NET_UDP_RECVV (int sck_number, int vector_number);
	Receives a packet array.  Return number of received packets.
	
		
- SOCKET SETS

	NET_SOCKETSET_ALLOC (int socketset_number, int maxsockets);
	Creates a socket set.  Returns 0 on success or -1 on error.
	
	NET_SOCKETSET_FREE (int socketset_number);
	Eliminates a socket set. Returns 0.
	
	NET_SOCKETSET_TCP_ADD (int socketset_number, int tcpsocket);
	Adds a TCP socket to the given set.  Returns number of used sockets in the set.
	
	NET_SOCKETSET_UDP_ADD (int socketset_number, int udpsocket);
	Adds an UDP socket to the given set.  Returns number of used sockets in the set.

	NET_SOCKETSET_TCP_DEL (int socketset_number, int tcpsocket);
	Removes the given TCP socket from the set.  Returns number of used sockets in the set.
	
	NET_SOCKETSET_UDP_DEL (int socketset_number, int udpsocket);
	Removes a given UPD socket from the set.  Returns number of used sockets in the set.	
	
	NET_SOCKETSET_CHECK (int socketset_number, int timeout);
	Checks if there is activity in the socket set.  Returns number of active sockets.
	
	NET_SOCKETSET_TCP_READY (int tcpsocket);
	Chects if there is activity in the given TCP socket.  Must be used before NET_SOCKETSET_CHECK.  Returns 0 if no activity or any other number otherwise.
	
	NET_SOCKETSET_UDP_READY (int udpsocket);
	Chects if there is activity in the given UDP socket.  Must be used before NET_SOCKETSET_CHECK.  Returns 0 if no activity or any other number otherwise.
	
	
Addition information in SDL_Net website: http://jcatki.no-ip.org/SDL_net/
