typedef enum e_bunny_comtype
{
 
ERROR,
 
EXPIRED,
 
NETCONNECTED,
 
NETDISCONNECTED,
 
MESSAGE
}
t_bunny_rgb;
INDEX
typedef enum e_bunny_comerror
{
 
YSTEM_FAIL,
 
ELECT_FAIL,
    CCEPT_FAIL,
  $WRITE_FAIL,
  $READ_FAIL,
    LLOC_FAIL,
  $GETTIME_FAIL,
 
LAST_NETWORK_ERROR
}
t_bunny_rgb;
INDEX
Attributes
-
const void * const _private[2]:
  Private fields you must not modify or your program may crash.
-
const int fd:
  The listening socket of the server.
Do not close it, do not use fcntl or ioctl on it.
-
const uint16_t port:
  The port on which the server listens.
INDEX
Description
  Create a new server. It will contains a listening socket of
type
protocol and listen on
port.
The returned server must be deleted with
bunny_delete_server.
Error values and logs
On error, $Vbunny_errno is set to:
-
ENOMEM:
Out of memory.
-
Any errno code that can be generated by socket, bind or listen.
Logs written by this function are tagged with the "network" label.
INDEX
Description
  Create a new server. It will contains a listening socket of
type
BPT_TCP and listen on
port.
The returned server must be deleted with
bunny_delete_server.
Parameters
-
uint16_t port:
  The port on which the server with listen.
Error values and logs
On error, $Vbunny_errno is set to:
-
ENOMEM:
Out of memory.
-
Any errno code that can be generated by socket, bind or listen.
Logs written by this function are tagged with the "network" label.
INDEX
Description
  Delete the sent server, close all associated connections.
INDEX
Parameters
-
t_bunny_server *server:
  The server to manage.
-
uint32_t timeout:
  Time allocated to network scheduling, in milliseconds.
INDEX
Description
  Push a write request for the connection fd, that is managed by server,
of data of length bytes.
Parameters
-
t_bunny_server *server:
  The server who own the sent file descriptor.
-
const void *data:
  The data to write.
-
size_t length:
  The length of the data to write.
-
int fd:
  The file descriptor representing the connection you want to write to.
Return value
Return true or false on error.
Error values and logs
On error, $Vbunny_errno is set to:
Logs written by this function are tagged with the "network" label.
INDEX
Description
  Delete the connection associated to the sent fd when every
of its associated write request will be achieved.
Parameters
-
t_bunny_server *server:
  The server who own the sent file descriptor.
-
int fd:
  The file descriptor you want to close.
Return value
Return true or false on error.
Error values and logs
On error, $Vbunny_errno is set to:
Logs written by this function are tagged with the "network" label.
INDEX
Attributes
-
const void * const _private[2]:
  Private fields you must not modify or your program may crash.
-
const int fd:
  The listening socket of the server.
Do not close it, do not use fcntl or ioctl on it.
-
const char * const host:
  The host on which the client is connected.
-
const uint16_t port:
  The port on which the server listens.
INDEX
Parameters
-
const char *host:
  The host to connect with.
-
uint16_t port:
  The port on which the client with listen.
-
t_bunny_protocol protocol:
  The nature of the listening socket.
Error values and logs
On error, $Vbunny_errno is set to:
-
ENOMEM:
Out of memory.
-
Any errno code that can be generated by socket, bind or connect.
Logs written by this function are tagged with the "network" label.
INDEX
Parameters
-
const char *host:
  The host to connect with.
-
uint16_t port:
  The port on which the client with listen.
Error values and logs
On error, $Vbunny_errno is set to:
-
ENOMEM:
Out of memory.
-
Any errno code that can be generated by socket, bind or connect.
Logs written by this function are tagged with the "network" label.
INDEX
Description
  Delete the sent client.
INDEX
Parameters
-
t_bunny_client *client:
  The client to manage.
-
uint32_t timeout:
  Time allocated to network scheduling, in milliseconds.
INDEX
Description
  Push a write request for the connection that is managed by client,
of data of length bytes.
Parameters
-
t_bunny_client *client:
  The client who own the sent file descriptor.
-
const void *data:
  The data to write.
-
size_t length:
  The length of the data to write.
Return value
Return true or false on error.
Error values and logs
On error, $Vbunny_errno is set to:
Logs written by this function are tagged with the "network" label.
INDEX
Description
  This type is fully abstract.
It represents a server or a client and is used by the bunny events module
to trigger network events.
INDEX