diff options
author | IOhannes m zmölnig <zmoelnig@users.sourceforge.net> | 2010-04-01 07:20:58 +0000 |
---|---|---|
committer | IOhannes m zmölnig <zmoelnig@users.sourceforge.net> | 2010-04-01 07:20:58 +0000 |
commit | 7ac448bb91b48fcc835c623272ef41cbbbba6d9b (patch) | |
tree | ffe413e4f360b64485deff347d5985ac95d643c7 | |
parent | ed35737b2cc95607125de03d8fa082e66e061408 (diff) |
convenience function for outputting the socket
svn path=/trunk/externals/iem/iemnet/; revision=13329
-rw-r--r-- | iemnet.c | 14 | ||||
-rw-r--r-- | iemnet.h | 11 |
2 files changed, 22 insertions, 3 deletions
@@ -28,12 +28,20 @@ void iemnet__addrout(t_outlet*status_outlet, t_outlet*address_outlet, if(address_outlet)outlet_list (address_outlet, gensym("list" ), 5, addr); } -void iemnet__numconnout(t_outlet*status_outlet, t_outlet*numconn_outlet, int numconnections) { +void iemnet__numconnout(t_outlet*status_outlet, t_outlet*numcon_outlet, int numconnections) { t_atom atom[1]; SETFLOAT(atom, numconnections); - if(status_outlet )outlet_anything(status_outlet , gensym("connections"), 1, atom); - if(address_outlet)outlet_float (address_outlet, numconnections); + if(status_outlet)outlet_anything(status_outlet , gensym("connections"), 1, atom); + if(numcon_outlet)outlet_float (numcon_outlet, numconnections); +} + +void iemnet__socketout(t_outlet*status_outlet, t_outlet*socket_outlet, int socketfd) { + t_atom atom[1]; + SETFLOAT(atom, socketfd); + + if(status_outlet)outlet_anything(status_outlet , gensym("socket"), 1, atom); + if(socket_outlet)outlet_float (socket_outlet, socketfd); } @@ -224,6 +224,17 @@ int iemnet__receiver_getsize(t_iemnet_receiver*); void iemnet__addrout(t_outlet*status_outlet, t_outlet*address_outlet, long address, unsigned short port); /** + * output the socket we received data from + * the given socket is first output through the status_outlet as a "socket" message + * and then as a single number through the socket_outlet + * + * \param status_outlet outlet for general status messages + * \param socket_outlet outlet for sockets only + * \param sockfd the socket + */ +void iemnet__socketout(t_outlet*status_outlet, t_outlet*socket_outlet, int sockfd); + +/** * output the number of connections * the given number of connections is first output through the status_outlet as a "connections" message * and then as a single number through the numconn_outlet |