Socket Functions: no longer supported (due to Win32 !)

Name

Socket Functions -- functions for manipulating socket independantly of the platform (Linux/Win32).

Synopsis

#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);

Description

These functions provides an simplified use of sockets. To do...

Details

socket_create ()

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