On 20.02.2008, at 17:31, Henning Thielemann wrote:
> I need some clarification on OpenSoundControl: Is a repsonse send for
> every synchronous message? That is, do I have to do as many 'wait's as
> 'send's? Or is a response send, whenever I call 'recv' and it is ok to
> wait only once after multiple 'send's?

this behavior is application specific. SuperCollider sends '/done'  
replies for each command tagged 'asynchronous', i.e. messages that  
are deferred to the non-realtime-thread. so yes, if you want to make  
sure each command completes before sending the next one, you need one  
wait per asynchronous command.

the '/sync' message is also very useful in asynchronous  
communication: it implements a barrier identified by an integer id,  
so you can chunk asynchronous commands that don't have a mutual  
dependency. the sf site seems to be down, here's the excerpt from  
Server-Command-Reference.html:

"/sync                                  notify when async commands have 
completed.
        int - a unique number identifying this command.
        
Replies with a /synced message when all asynchronous commands  
received before this one have completed. The reply will contain the  
sent unique ID.
Asynchronous. Replies to sender with /synced, ID when complete."

to avoid a race, i think you need to send all the commands and /sync  
in the same bundle, or else /sync might arrive before the last  
command and consequently you might get /synced too early. that's not  
a problem with TCP, of course.

<sk>

_______________________________________________
haskell-art mailing list
haskell-art@lists.lurk.org
http://lists.lurk.org/mailman/listinfo/haskell-art

Reply via email to