[PD-dev] mrpeach/net/tcpserver

IOhannes m zmoelnig zmoelnig at iem.at
Tue Dec 12 09:54:25 CET 2006


martin.peach at sympatico.ca wrote:
> I get:
>  if(argc < 2)
> on line 420, so I don't get it...

oops, you are totally right. vi tells me it is line #459, but by
(x)emacs tells me it is line #420.

this is what you get, when you are trying to be overly cool and just
provide a bare minimum on information...



> But whatever it really is, go ahead and change it if you think it works.


diff -u -r1.3 tcpserver.c
--- tcpserver.c 28 Nov 2006 16:42:30 -0000      1.3
+++ tcpserver.c 12 Dec 2006 08:45:00 -0000
@@ -443,14 +443,12 @@
 static void tcpserver_broadcast(t_tcpserver *x, t_symbol *s, int argc,
t_atom *argv)
 {
     int     client;
-
     /* enumerate through the clients and send each the message */
     for(client = 0; client < x->x_nconnections; client++)      /* check
if connection exists */
     {
         if(x->x_fd[client] >= 0)
         { /* socket exists for this client */
             tcp_server_send_bytes(client, x, argc, argv);
-            break;
         }
     }
 }



the original code would send the data to the first valid client and then
stop the broadcast (by break'ing the loop).
imo, "broadcast" here means "send to _all_ valid clients".

since i think it fixes a bug i will change it.
i was just wandering whether this clause was there on purpose (e.g.
because the system usually locked up or something; i haven't encountered
any problems yet)


mfga.sdr
IOhannes





More information about the Pd-dev mailing list