|
From: Stephen S. <rad...@gm...> - 2012-10-13 00:41:41
|
Hm, this is worth testing more thoroughly, I hadn't thought about notifying on connection/disconnection. Personally I prefer to treat OSC as connectionless on the application layer, even if it's over TCP for reliability, but I can see how it would make some sense to allow per-connection notification in some cases. Usually if I remember correctly I think the send() or recv() returns 0 if the socket is correctly disconnected, or an error if it is suddenly disconnected, so Camille is right that you should be able to use this to detect disconnection while sending. However since liblo tends to provide quite some insulation from raw POSIX, it wouldn't be a bad thing to trigger events. I'm only a little worried about "callback creep" which has been happening as features get added... Maybe it's no big deal though. Please do try to remember however that OSC is really envisioned as a stateless, connectionless protocol, meant to carry signal-oriented data, not really for being a "remote procedure call" mechanism, even though, of course, it could be used that way. On the other hand, I could imagine e.g. some kind of synthesizer that allocates new voices for each connection, among other things. Steve On Thu, Oct 4, 2012 at 10:15 AM, Camille Troillard <ca...@os...> wrote: > Hi William, > > As far as I know, TCP will not notify you on disconnection, unless you read or write the socket in which case you know it is disconnected by the result returned from recv() or send(). > > In the case of liblo, lo_send_message returns the same value as send() would do, that is: > > Upon successful completion, the number of bytes which were sent is > returned. Otherwise, -1 is returned and the global variable errno is set > to indicate the error. > > > > Best, > Cam > > > > On 4 oct. 2012, at 15:51, William Light <li...@wr...> wrote: > >> Hey all, >> Quite stoked about the recent work on OSC over TCP. I'm hoping it's >> going to make some features I've been mulling over for my application >> possible. >> >> One of the things I need to get, though, is a notification whenever a >> client disconnects. I need to allocate state for each client, and having >> disconnection messages *only* at the application layer makes me nervous, >> especially since TCP takes care of this at the transport layer. >> >> Is there any way I could get a notification of a client disconnecting? >> >> Regards, >> -w >> >> ------------------------------------------------------------------------------ >> Don't let slow site performance ruin your business. Deploy New Relic APM >> Deploy New Relic app performance management and know exactly >> what is happening inside your Ruby, Python, PHP, Java, and .NET app >> Try New Relic at no cost today and get our sweet Data Nerd shirt too! >> http://p.sf.net/sfu/newrelic-dev2dev >> _______________________________________________ >> liblo-devel mailing list >> lib...@li... >> https://lists.sourceforge.net/lists/listinfo/liblo-devel > > > ------------------------------------------------------------------------------ > Don't let slow site performance ruin your business. Deploy New Relic APM > Deploy New Relic app performance management and know exactly > what is happening inside your Ruby, Python, PHP, Java, and .NET app > Try New Relic at no cost today and get our sweet Data Nerd shirt too! > http://p.sf.net/sfu/newrelic-dev2dev > _______________________________________________ > liblo-devel mailing list > lib...@li... > https://lists.sourceforge.net/lists/listinfo/liblo-devel |