| TiFFEP Reference Manual | |||
|---|---|---|---|
| <<< Previous Page | Home | Up | Next Page >>> |
#include <tiffep.h> (sock.h, com_defs.h) Types Linux: typedef int Sock; typedef struct sockaddr_un SockAddr; Win32: typedef SOCKET Sock; typedef struct sockaddr SockAddr; DLLEXPORTed functions gint socket_create (Sock *sd); gint socket_bind (Sock sd); gint socket_listen (Sock sd, gint max_log); gint socket_accept (Sock sd, Sock *nsd); gint socket_send (Sock sd, void *data, gint len); gint socket_recv (Sock sd, void *data, gint len, gint *read); gint socket_connect (Sock sd); gint socket_close (Sock nsd); gint socket_send_msg (Sock sd, TiffepMsg *msg); gint socket_recv_msg (Sock sd, TiffepMsg *msg, gint *read); |
gint socket_create (Sock *sd); |
Create a socket and return a socket descriptor.
| sd : | the socket desciptor |
| Returns : | 0 if success, an error code otherwise |
gint socket_bind (Sock sd); |
Bind the socket, i.e. assigns a name to it.
| sd : | the socket desciptor |
| Returns : | 0 if success, an error code otherwise |
gint socket_listen (Sock sd, gint max_log); |
Listen a socket. Accept up to max_log connections.
| sd : | the socket desciptor |
|
max_log :
|
the maximum number of simultaneous connections |
| Returns : | 0 if success, an error code otherwise |
gint socket_accept (Sock sd, Sock *nsd); |
Accept a connection on the socket. Returns the new socket descriptor associated with it.
| sd : | the socket desciptor |
|
nsd :
|
the new socket descriptor |
| Returns : | 0 if success, an error code otherwise |
gint socket_send (Sock sd, void *data, gint len); |
Send some data to a socket.
| sd : | the socket desciptor |
|
data :
|
the data buffer to transmit |
|
len :
|
the length of the data buffer |
| Returns : | 0 if success, an error code otherwise |
gint socket_recv (Sock sd, void *data, gint len, gint *read); |
Receive data from a socket.
| sd : | the socket desciptor |
|
data :
|
the buffer for storing received data |
|
len :
|
the max length of the buffer |
|
read :
|
? |
| Returns : | 0 if success, an error code otherwise |
gint socket_connect (Sock sd); |
Connect to a socket.
| sd : | the socket desciptor |
| Returns : | 0 if success, an error code otherwise |
gint socket_close (Sock nsd); |
Close a previously connected and binded socket.
| nsd : | a binded socket desciptor |
| Returns : | 0 if success, an error code otherwise |
gint socket_send_msg (Sock sd, TiffepMsg *msg); |
Send a TiFFEP message to the specified socket.
| sd : | the socket desciptor |
|
msg :
|
a TiFFEP msg to send |
| Returns : | 0 if success, an error code otherwise |
gint socket_recv_msg (Sock sd, TiffepMsg *msg, gint *read); |
Receive a TiFFEP message from a socket.
| sd : | the socket desciptor |
|
msg :
|
the message to receive |
|
read :
|
? |
| Returns : | 0 if success, an error code otherwise |
| <<< Previous Page | Home | Up | Next Page >>> |
| String Utility Functions | Hook Functions | ||