aboutsummaryrefslogtreecommitdiff
path: root/iemnet.h
diff options
context:
space:
mode:
authorIOhannes m zmölnig <zmoelnig@users.sourceforge.net>2010-03-25 08:28:59 +0000
committerIOhannes m zmölnig <zmoelnig@users.sourceforge.net>2010-03-25 08:28:59 +0000
commit6c4cb319c6e16e865fac23a3cca91a3d23549154 (patch)
treece5373906dcbb7c5cb532acf47676d640a5a732f /iemnet.h
parent29f2b2b9168fd2d45ec5a2699dab2e5ab44ad10b (diff)
most of the tcp-objects seem to work now;
performance increase as measured until now is great :-) svn path=/trunk/externals/iem/iemnet/; revision=13266
Diffstat (limited to 'iemnet.h')
-rw-r--r--iemnet.h16
1 files changed, 14 insertions, 2 deletions
diff --git a/iemnet.h b/iemnet.h
index 1b5fc22..955b6ca 100644
--- a/iemnet.h
+++ b/iemnet.h
@@ -34,15 +34,27 @@
#include "m_pd.h"
+/* from s_stuff.h */
+typedef void (*t_fdpollfn)(void *ptr, int fd);
+EXTERN void sys_closesocket(int fd);
+EXTERN void sys_sockerror(char *s);
+EXTERN void sys_addpollfn(int fd, t_fdpollfn fn, void *ptr);
+EXTERN void sys_rmpollfn(int fd);
+
+
+
#ifdef _WIN32
# include <winsock2.h>
# include <ws2tcpip.h>
#else
+# include <netdb.h>
+# include <arpa/inet.h>
# include <sys/socket.h>
#endif
typedef struct _iemnet_chunk {
unsigned char* data;
+
size_t size;
} t_iemnet_chunk;
@@ -70,13 +82,13 @@ int iemnet__sender_setsockopt(t_iemnet_sender*, int level, int optname, const vo
#define t_iemnet_receiver struct _iemnet_receiver
EXTERN_STRUCT _iemnet_receiver;
-typedef void (*t_iemnet_receivecallback)(void*x, int sockfd, int argc, t_atom*argv);
+typedef void (*t_iemnet_receivecallback)(void*data, int argc, t_atom*argv);
/**
* create a receiver object: whenever something is received on the socket,
* the callback is called with the payload
*/
-t_iemnet_receiver*iemnet__receiver_create(int sock, void*owner, t_iemnet_receivecallback callback);
+t_iemnet_receiver*iemnet__receiver_create(int sock, void*data, t_iemnet_receivecallback callback);
void iemnet__receiver_destroy(t_iemnet_receiver*);