Ok, I have been able to isolate it and create a test patch.
The bug is triggered when, immediately after connecting (i.e. triggered by the 1 output by netsend), you send MANY messages through netsend. The first X messages are lost, where X is not necessarily an integer. I guess it is an overflow in some buffer.
Note that if you send the very same amount of messages at any other moment, not immediately after connecting, they are sent correctly.
I attach the test patch.
I will file it to the bug tracker - I post it here just because it answer the question I previously posted
2008/2/11, matteo sisti sette matteosistisette@gmail.com:
Hi,
I use netsend and netreceive to send messages across 2 instances of pd on the same machine (localhost).
I use the outlet of netsend to detect when netsend is connected, and when it is ([select 1]) I immediately send out some data through it.
IN SOME CASES (no consistent behaviour detected), these data that are sent just after the connection is established, are simply LOST, i.e. they are not received at the other end, and netsend does NOT give the error "netsend: not connected".
I cannot provide a test patch, since in any simple test this does not happen, but when I put the very very exact same thing into a bigger patch, this happens.
Even a [delay 0] between detecting the active connection and sending the data does not fix the problem, while a [delay 500] for example does.
In summary the problem is: Messages sent to a [netsend] immediately after the connection is established (after netsend has output a 1) may be lost, without issuing an error message.
Has anyone experienced it?
Any suggestion on how to systematically trigger it so as to produce a test patch to post to the bug tracker?
The bug may even be in netreceive, not necessarily netsend.
-- Matteo Sisti Sette matteosistisette@gmail.com http://www.matteosistisette.com