From f28bdb390c81800ed9eb47803216c76327a4f682 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?IOhannes=20m=20zm=C3=B6lnig?= Date: Fri, 26 Mar 2010 14:31:28 +0000 Subject: 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 --- tcpclient.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'tcpclient.c') 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); -- cgit v1.2.1