ENet v1.3.18
Reliable UDP networking library
Macros | Typedefs | Functions
unix.c File Reference

ENet Unix system specific functions. More...

#include <sys/types.h>
#include <sys/socket.h>
#include <sys/ioctl.h>
#include <sys/time.h>
#include <netinet/tcp.h>
#include <netdb.h>
#include <unistd.h>
#include <string.h>
#include <errno.h>
#include <time.h>
#include "enet/enet.h"

Macros

#define ENET_BUILDING_LIB   1
 
#define MSG_NOSIGNAL   0
 

Typedefs

typedef int socklen_t
 

Functions

int enet_address_get_host (const ENetAddress *address, char *name, size_t nameLength)
 Attempts to do a reverse lookup of the host field in the address parameter. More...
 
int enet_address_get_host_ip (const ENetAddress *address, char *name, size_t nameLength)
 Gives the printable form of the IP address specified in the address parameter. More...
 
int enet_address_set_host (ENetAddress *address, const char *name)
 Attempts to resolve the host named by the parameter hostName and sets the host field in the address parameter if successful. More...
 
int enet_address_set_host_ip (ENetAddress *address, const char *name)
 Attempts to parse the printable form of the IP address in the parameter hostName and sets the host field in the address parameter if successful. More...
 
void enet_deinitialize (void)
 Shuts down ENet globally. More...
 
enet_uint32 enet_host_random_seed (void)
 
int enet_initialize (void)
 Initializes ENet globally. More...
 
ENetSocket enet_socket_accept (ENetSocket socket, ENetAddress *address)
 
int enet_socket_bind (ENetSocket socket, const ENetAddress *address)
 
int enet_socket_connect (ENetSocket socket, const ENetAddress *address)
 
ENetSocket enet_socket_create (ENetSocketType type)
 
void enet_socket_destroy (ENetSocket socket)
 
int enet_socket_get_address (ENetSocket socket, ENetAddress *address)
 
int enet_socket_get_option (ENetSocket socket, ENetSocketOption option, int *value)
 
int enet_socket_listen (ENetSocket socket, int backlog)
 
int enet_socket_receive (ENetSocket socket, ENetAddress *address, ENetBuffer *buffers, size_t bufferCount)
 
int enet_socket_send (ENetSocket socket, const ENetAddress *address, const ENetBuffer *buffers, size_t bufferCount)
 
int enet_socket_set_option (ENetSocket socket, ENetSocketOption option, int value)
 
int enet_socket_shutdown (ENetSocket socket, ENetSocketShutdown how)
 
int enet_socket_wait (ENetSocket socket, enet_uint32 *condition, enet_uint32 timeout)
 
int enet_socketset_select (ENetSocket maxSocket, ENetSocketSet *readSet, ENetSocketSet *writeSet, enet_uint32 timeout)
 
enet_uint32 enet_time_get (void)
 Returns the wall-time in milliseconds. More...
 
void enet_time_set (enet_uint32 newTimeBase)
 Sets the current wall-time in milliseconds. More...
 

Detailed Description

ENet Unix system specific functions.

Macro Definition Documentation

◆ ENET_BUILDING_LIB

#define ENET_BUILDING_LIB   1

◆ MSG_NOSIGNAL

#define MSG_NOSIGNAL   0

Typedef Documentation

◆ socklen_t

typedef int socklen_t

Function Documentation

◆ enet_host_random_seed()

enet_uint32 enet_host_random_seed ( void  )

◆ enet_time_get()

enet_uint32 enet_time_get ( void  )

Returns the wall-time in milliseconds.

Its initial value is unspecified unless otherwise set.

◆ enet_time_set()

void enet_time_set ( enet_uint32  newTimeBase)

Sets the current wall-time in milliseconds.