2013/7/3 IOhannes m zmoelnig zmoelnig@iem.at
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
On 2013-07-03 17:33, Antoine Villeret wrote:
so it could be difficult to use a server which doesn't accept more than one connection...
no that's not what i meant. you can have as many connections as you want, but they cannot be maintained at the same time.
simple example:
- both clientA and clientB send a a query to the server
- to complicate things, they do so at exactly the same time
- but since IP is a serial protocol, they will somehow arrive one
after each other - let's assume clientB was faster
- [udpserver] will output the query from clientB
- if the server-patch now immediately responds to that query, the
response will be sent back to clientB
- then [udpserver] will output the query from clientA.
- [udpserver] will forget everything about clientB
- if the server-patch responds immediately to that query, the response
will be sent back to clientB
- if you later "send" something from the server, it will still be sent
to clientB (because clientB is the last known connection)
so in this case, if I understand correctly, udpserver never send an answer to clientA ? I have to disconnect clientB *before* connecting clientA ? but how clientA will know this is time to connect ? should it try until the connection is accepted ?
so you can have as many "connections" as you want, but they have to be handled atomically - on after another. you cannot have clientA and clientB connect to the server, and make the server send info to both simultaneously. instead you have to adapt a query/response scheme, where each client asks the server for piece of information.
this what I'm doing now, the client connects then ask for something and when it receive the answer it disconnects if there is no answer it disconnect after xx second
concerning [udpserver], I try to reproduce the scenario above with your github's version : I start 3 pd : one with udpserver-help.pd, and the 2 other with udpclient-help.pd
I connect the clientA, send some data, the server receives them and the server sends back something else to the client then I disconnect the clientA and connect clientB, but when clientB tries to send data I got in the pd console on server side : [udpserver] received disconnection event and in the command line : iemnet:sender-shutdown: Transport endpoint is not connected
and on the client side, in the terminal I got : iemnet:sender-shutdown: Bad file descriptor
I know "[udpserver] does not work yet" but as we are talking about it, I want to try your version I just file a report for that
thanks for all
antoine
fgamsdr IOhannes -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.12 (GNU/Linux) Comment: Using GnuPG with Icedove - http://www.enigmail.net/
iEYEARECAAYFAlHUSAkACgkQkX2Xpv6ydvQ7dQCfWd6Ms++xbvpFYHMUArPILPeA fA8AoOo0uQuuQnJV5FBafbRsggXOqtzx =29SY -----END PGP SIGNATURE-----
Pd-dev mailing list Pd-dev@iem.at http://lists.puredata.info/listinfo/pd-dev