[PD] osc objects

Martin Peach martinrp at vax2.concordia.ca
Tue May 9 19:36:22 CEST 2006

Hans-Christoph Steiner wrote:

> On May 1, 2006, at 6:35 PM, Martin Peach wrote:
>> Hans-Christoph Steiner wrote:
>>> I have to say that I really think that tcp and udp objects should  
>>> be  bidirectional.  TCP and UDP sockets are, so the objects  should  
>>> represent that.  I've done quite a bit of network  programming with 
>>> Pd  and I never use [netsend]/[netreceive].  I  always use 
>>> [netserver]/ [netclient] because of the bidirectional  connection 
>>> and the client  management of the [netserver].
>> OK, it looks like basically the same modifications are needed to  
>> change [netserver] and [netclient] to byte mode from pd message  mode 
>> as I did with [netsend] and [netreceive]. Will have a go.
> Just out of curiousity, why do you use byte mode rather than message  
> mode?  Do you mean that you are sending one byte per packet?
I mean that netsend sends messages terminated with a semicolon and 
tcpsend/udpsend sends messages that are just bytes, so there is no 
escaping or interpretation done (except to check that each element is 
encodable as a single byte). It won't send a lone byte unless the 
message contains only one byte.
For example the message
[send 13 10(
will send a CR/LF as two bytes.

> What about just a [socket] object which could also do UNIX sockets,  
> or any other kind?  It would probably be more work, but worth it in  
> the long run.  Then [tcpsocket], etc. could be a Pd object.
Yes this is probably the best idea.
I'm looking at the netclient and netserver code to see if they can be 
combined somehow. I'm moving incrementally so as not to lose everything...
Unix sockets don't exist on Windows. Do they exist on MacOS? Does 
anybody use them, I mean is there any  advantage in using a unix socket 
versus a udp socket?
I notice that netserver/netclient use timers and pthreads while 
netsend/netreceive use pollfunctions. Is there any preference for either?

> .hc
>> Martin
>>> I think the "server" aspect could be a separate object.  I think  
>>> the  socket objects should represent just the sockets, and how the  
>>> sockets  work.
How would that work in PD? Seems a server would have to be connected to 
one or more sockets that are dynamically created as connections come in.


>>> .hc
>>> _____________________________________________________________________ 
>>> ___ ____
>>> "Information wants to be free."
>>>                                      -Stewart Brand
>>> _______________________________________________
>>> PD-list at iem.at mailing list
>>> UNSUBSCRIBE and account-management -> http://lists.puredata.info/ 
>>> listinfo/pd-list
> ________________________________________________________________________ 
> ____
> "Terrorism is not an enemy.  It cannot be defeated.  It's a tactic.   
> It's about as sensible to say we declare war on night attacks and  
> expect we're going to win that war.  We're not going to win the war  
> on terrorism."
>                                     - retired U.S. Army general,  
> William Odom

More information about the Pd-list mailing list