diff options
author | IOhannes m zmölnig <zmoelnig@users.sourceforge.net> | 2010-03-26 14:31:28 +0000 |
---|---|---|
committer | IOhannes m zmölnig <zmoelnig@users.sourceforge.net> | 2010-03-26 14:31:28 +0000 |
commit | f28bdb390c81800ed9eb47803216c76327a4f682 (patch) | |
tree | cfece0b7743e9aa3330d64b0c62eca1710a9e9eb /tcpclient.c | |
parent | 78bf82a8454213f38467fa24add174295fbeec69 (diff) |
changed API of read-callback
the callback will provide the raw data chunk as well (easier to add more data)
svn path=/trunk/externals/iem/iemnet/; revision=13273
Diffstat (limited to 'tcpclient.c')
-rw-r--r-- | tcpclient.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/tcpclient.c b/tcpclient.c index c7bffe2..1913c43 100644 --- a/tcpclient.c +++ b/tcpclient.c @@ -63,7 +63,9 @@ typedef struct _tcpclient } t_tcpclient; -static void tcpclient_receive_callback(t_tcpclient *x, int sockfd, int argc, t_atom*argv); +static void tcpclient_receive_callback(void *x, + t_iemnet_chunk*, + int argc, t_atom*argv); @@ -116,7 +118,7 @@ static void *tcpclient_child_connect(void *w) x->x_addr = ntohl(*(long *)hp->h_addr); x->x_sender=iemnet__sender_create(sockfd); - x->x_receiver=iemnet__receiver_create(sockfd, x, (t_iemnet_receivecallback)tcpclient_receive_callback); + x->x_receiver=iemnet__receiver_create(sockfd, x, tcpclient_receive_callback); x->x_connectstate = 1; @@ -178,8 +180,8 @@ static void tcpclient_send(t_tcpclient *x, t_symbol *s, int argc, t_atom *argv) outlet_anything( x->x_statusout, gensym("sent"), 1, &output_atom); } -static void tcpclient_receive_callback(t_tcpclient *x, int sockfd, int argc, t_atom*argv) { - // ignore sockfd +static void tcpclient_receive_callback(void*y, t_iemnet_chunk*c, int argc, t_atom*argv) { + t_tcpclient *x=(t_tcpclient*)y; if(argc) { outlet_list(x->x_msgout, gensym("list"), argc, argv); |