summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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,