aboutsummaryrefslogtreecommitdiff
path: root/tcpreceive.c
diff options
context:
space:
mode:
authorIOhannes m zmölnig <zmoelnig@users.sourceforge.net>2010-04-07 14:45:28 +0000
committerIOhannes m zmölnig <zmoelnig@users.sourceforge.net>2010-04-07 14:45:28 +0000
commit4902493c79875a2e39468b31f384fe333cb81e2b (patch)
treeca0c19fb4c5e55b89003df9562d4a92b4d78f36a /tcpreceive.c
parent4fa185a5450d9ec1516aa159f4e9dbc1c77a0839 (diff)
iemnet__streamout() takes an argument telling us whether to serialize or not
(non-serialization might be useful for proxies) svn path=/trunk/externals/iem/iemnet/; revision=13393
Diffstat (limited to 'tcpreceive.c')
-rw-r--r--tcpreceive.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/tcpreceive.c b/tcpreceive.c
index e0e348b..3bd73a8 100644
--- a/tcpreceive.c
+++ b/tcpreceive.c
@@ -55,6 +55,8 @@ typedef struct _tcpreceive
int x_connectsocket;
int x_port;
+ int x_serialize;
+
int x_nconnections;
t_tcpconnection x_connection[MAX_CONNECTIONS];
@@ -84,7 +86,7 @@ static void tcpreceive_read_callback(void *w, t_iemnet_chunk*c)
if(c) {
// TODO?: outlet info about connection
x->x_floatlist=iemnet__chunk2list(c, x->x_floatlist); // gets destroyed in the dtor
- iemnet__streamout(x->x_msgout, x->x_floatlist->argc, x->x_floatlist->argv);
+ iemnet__streamout(x->x_msgout, x->x_floatlist->argc, x->x_floatlist->argv, x->x_serialize);
} else {
// disconnected
tcpreceive_disconnect(x, index);
@@ -287,6 +289,10 @@ static void tcpreceive_port(t_tcpreceive*x, t_floatarg fportno)
outlet_anything(x->x_statout, gensym("port"), 1, ap);
}
+static void tcpreceive_serialize(t_tcpreceive *x, t_floatarg doit) {
+ x->x_serialize=doit;
+}
+
static void tcpreceive_free(t_tcpreceive *x)
{ /* is this ever called? */
@@ -311,6 +317,8 @@ static void *tcpreceive_new(t_floatarg fportno)
x->x_connectout = outlet_new(&x->x_obj, gensym("float")); /* legacy */
x->x_statout = outlet_new(&x->x_obj, 0);/* outlet for everything else */
+ x->x_serialize=1;
+
x->x_connectsocket=-1;
x->x_port=-1;
x->x_nconnections=0;
@@ -341,6 +349,9 @@ IEMNET_EXTERN void tcpreceive_setup(void)
A_DEFFLOAT, 0);
class_addmethod(tcpreceive_class, (t_method)tcpreceive_port, gensym("port"), A_DEFFLOAT, 0);
+
+ class_addmethod(tcpreceive_class, (t_method)tcpreceive_serialize, gensym("serialize"), A_FLOAT, 0);
+
}
IEMNET_INITIALIZER(tcpreceive_setup);