From ab7132a03e9be01340c04d228731372ff40ddf16 Mon Sep 17 00:00:00 2001 From: fcolin Date: Tue, 12 Jul 2005 15:53:07 +0000 Subject: suppression du terminateur dans le code socket en vu d'une transmission binaire --- src/ivysocket.h | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) (limited to 'src/ivysocket.h') diff --git a/src/ivysocket.h b/src/ivysocket.h index b57a632..9bfb17f 100644 --- a/src/ivysocket.h +++ b/src/ivysocket.h @@ -53,13 +53,15 @@ extern int make_message_var(char ** buffer, int *size, int offset, const char * /* Forward def */ typedef struct _client *Client; -typedef void (*SocketInterpretation) (Client client, void *data, char *ligne); +typedef char* (*SocketInterpretation) (Client client, void *data, char *ligne, unsigned long len); +typedef void* (*SocketCreate) (Client client); +typedef void (*SocketDelete) (Client client, void *data); /* Server Part */ typedef struct _server *Server; extern Server SocketServer(unsigned short port, - void*(*create)(Client client), - void(*handle_delete)(Client client, void *data), + SocketCreate create, + SocketDelete handle_delete, SocketInterpretation interpretation); extern unsigned short SocketServerGetPort( Server server ); extern void SocketServerClose( Server server ); @@ -76,17 +78,13 @@ extern void SocketBroadcast( char *fmt, ... ); extern Client SocketConnect( char * host, unsigned short port, void *data, SocketInterpretation interpretation, - char terminator, - void (*handle_delete)(Client client, void *data) - ); + SocketDelete handle_delete + ); extern Client SocketConnectAddr( struct in_addr * addr, unsigned short port, void *data, SocketInterpretation interpretation, - char terminator, - void (*handle_delete)(Client client, void *data) + SocketDelete handle_delete ); -extern int SocketWaitForReply( Client client, char *buffer, int size, int delai); - /* Socket UDP */ /* Creation d'une socket en mode non connecte */ /* et ecoute des messages */ -- cgit v1.1