aboutsummaryrefslogtreecommitdiff
path: root/udpreceive.c
diff options
context:
space:
mode:
authorIOhannes m zmölnig <zmoelnig@users.sourceforge.net>2010-04-07 14:27:36 +0000
committerIOhannes m zmölnig <zmoelnig@users.sourceforge.net>2010-04-07 14:27:36 +0000
commit9ab98fb29cffdb6d9ff7b4cf988705b291423114 (patch)
treed4a63937e0bde90aa0adfe6259f8144993261c34 /udpreceive.c
parentd035d4d51e71c3355972682a815ab2b35e5f0ac5 (diff)
new receiver callback: chunk2list has to be handled by client
svn path=/trunk/externals/iem/iemnet/; revision=13391
Diffstat (limited to 'udpreceive.c')
-rw-r--r--udpreceive.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/udpreceive.c b/udpreceive.c
index 0d60c2d..63e226e 100644
--- a/udpreceive.c
+++ b/udpreceive.c
@@ -40,16 +40,15 @@ typedef struct _udpreceive
int x_connectsocket;
int x_port;
t_iemnet_receiver*x_receiver;
+ t_iemnet_floatlist *x_floatlist;
} t_udpreceive;
-static void udpreceive_read_callback(void*y,
- t_iemnet_chunk*c,
- int argc, t_atom*argv) {
+static void udpreceive_read_callback(void*y, t_iemnet_chunk*c) {
t_udpreceive*x=(t_udpreceive*)y;
- if(argc) {
- iemnet__addrout(x->x_statout, x->x_addrout, c->addr, c->port);
- outlet_list(x->x_msgout, gensym("list"), argc, argv);
+ if(c) {
+ x->x_floatlist=iemnet__chunk2list(c, x->x_floatlist); // gets destroyed in the dtor
+ outlet_list(x->x_msgout, gensym("list"), x->x_floatlist->argc, x->x_floatlist->argv);
} else {
post("[%s] nothing received", objName);
}
@@ -133,6 +132,9 @@ static void *udpreceive_new(t_floatarg fportno)
x->x_connectsocket = -1;
x->x_port = -1;
x->x_receiver = NULL;
+
+ x->x_floatlist=iemnet__floatlist_create(1024);
+
udpreceive_port(x, fportno);
return (x);
@@ -146,6 +148,8 @@ static void udpreceive_free(t_udpreceive *x)
outlet_free(x->x_msgout);
outlet_free(x->x_addrout);
outlet_free(x->x_statout);
+
+ if(x->x_floatlist)iemnet__floatlist_destroy(x->x_floatlist);x->x_floatlist=NULL;
}
IEMNET_EXTERN void udpreceive_setup(void)