[PD] netsend/netreceive + GUI bug

martin.peach at sympatico.ca martin.peach at sympatico.ca
Wed Aug 3 20:29:25 CEST 2011


> 
> > hmm, i don't know where you get this idea from, but to me, the code of
> > Pd's networking infrastructure looks, as if
> > a) all incoming traffic was polled for in the main thread
> > b) all output of this traffic  (to the Pd-patch) was propery protected
> > by sys_lock()
> 
> I am honestly not that familiar with this low-level aspect of pd. What I am however aware of is that the poll function responsible for receiving message (meaning when it arrives at the socket) inside netreceive immediately dispatches it to pd and its polling is linked not to pd's main loop but to the moment when the socket has received a packet which appears to be a part of any basic network socket example code available online and as far as I can see, I did not notice any relationship between its polling intervals and Pd's main loop. 
> 

If you are indeed talking about vanilla netsend and netreceive, the poll function is called during pd's main loop, not when something arrives at the socket.
In x_net.c :
sys_addpollfn(sockfd, (t_fdpollfn)socketreceiver_read, y);
socketreceiver_read is in s_inter.c:
void socketreceiver_read(t_socketreceiver *x, int fd)
sys_addpollfunction schedules the function to be called each pass through Pd's main loop.

Martin

 		 	   		  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puredata.info/pipermail/pd-list/attachments/20110803/98484ab6/attachment.htm>


More information about the Pd-list mailing list