summaryrefslogtreecommitdiff
path: root/src/ivysocket.h
diff options
context:
space:
mode:
authorfcolin1998-10-20 11:31:12 +0000
committerfcolin1998-10-20 11:31:12 +0000
commite54cc4c102de2899701122ea264e9d5116275507 (patch)
tree7ead1c277dd919f89a7e861347fa8cc3a9ef5c6a /src/ivysocket.h
parent1f7a8addff7d53729f7250c17ee125627efd59ba (diff)
downloadivy-c-e54cc4c102de2899701122ea264e9d5116275507.zip
ivy-c-e54cc4c102de2899701122ea264e9d5116275507.tar.gz
ivy-c-e54cc4c102de2899701122ea264e9d5116275507.tar.bz2
ivy-c-e54cc4c102de2899701122ea264e9d5116275507.tar.xz
correction bus sur buscleanup
gestion liste et fermeture serveur
Diffstat (limited to 'src/ivysocket.h')
-rw-r--r--src/ivysocket.h23
1 files changed, 13 insertions, 10 deletions
diff --git a/src/ivysocket.h b/src/ivysocket.h
index 2258caf..e1dd1f4 100644
--- a/src/ivysocket.h
+++ b/src/ivysocket.h
@@ -17,12 +17,23 @@ extern "C" {
#include <netinet/in.h>
#endif
+/* General Init */
+extern void SocketInit();
-/* Server Part */
+/* Forward def */
typedef struct _client *Client;
typedef void (*SocketInterpretation)( Client client, void *data, char *ligne);
-extern void SocketInit();
+/* Server Part */
+typedef struct _server *Server;
+extern Server SocketServer(unsigned short port,
+ void*(*create)(Client client),
+ void(*handle_delete)(Client client, void *data),
+ SocketInterpretation interpretation);
+extern unsigned short SocketServerGetPort( Server server );
+extern void SocketServerClose( Server server );
+
+/* Client Part */
extern void SocketClose( Client client );
extern void SocketSend( Client client, char *fmt, ... );
@@ -31,14 +42,6 @@ extern char *SocketGetPeerHost( Client client );
extern void SocketSetData( Client client, void *data );
extern void *SocketGetData( Client client );
extern void SocketBroadcast( char *fmt, ... );
-
-extern int SocketServer(unsigned short port,
- void*(*create)(Client client),
- void(*handle_delete)(Client client, void *data),
- SocketInterpretation interpretation);
-
-/* Client Part */
-
extern Client SocketConnect( char * host, unsigned short port,
void *data,
SocketInterpretation interpretation,