[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [sc-users] TCP default?
uhm, yeah - I was about to suggest testing in Python. ;)
Or have a go w/ Processing: http://www.sojamo.de/libraries/oscP5/
Or C++ … whatever ...
BTW, it’s a good idea to avoid any kind of non-private connection at all cost - troubles invited, otherwise.
Happy New Year!
;) m.
On 31.Dec 2016, at 19:07 , Glen Fraser <holaglen@xxxxxxxxx> wrote:
> Yes, the Server can do TCP. You have to boot it with the -t <port> argument, rather than the usual -u <port> for UDP.
>
> So I just experimented more with this, and finally found out how it can work for other app communication. You need a program (a “server”, but don’t be confused with scsynth, I’m not talking about that) that sends and receives TCP OSC messages. Being a TCP stream, that means they need to include the number of bytes as a 4-byte int prepended to the message…luckily sclang handles this for you when you do sendMsg() with a TCP-connected NetAddr.
>
> I’m very happy with this, which means I can get reliability for my own OSC “control” messaging when running various apps on a router. (I’m not so interested in it for the Server, or when running on localhost).
>
> I can show an example (e.g. with a minimal TCP server in Python) if needed…but not right now.
>
> Happy New Year everyone,
> Glen.
>
>
>> On 31 Dec 2016, at 04:33, Michael Zacherl <sdiy-mz01@xxxxxxxxxxxxx> wrote:
>>
>>
>>
>> On 30.Dec 2016, at 19:30 , Glen F <holaglen@xxxxxxxxx> wrote:
>>
>>> No, you need to choose the port of a TCP server (e.g. an external program you've written) that's listening for connections. You can connect to it using the NetAddr.connect instance method, but there seems to be no way to read from it.
>>
>> ok, but the server can do tcp?
>>
>>
>>> (Hmm, unless you can just use the Netaddr.socket with some sclang file or serial port read function... I'll have to try doing that.)
>>
>> would be interesting.
>>
>> I do agree that on the local machine udp should not be a problem (besides local congestion, which is theoretically possible). But I sense tcp could be an interesting issue when going abroad ... outside the box.
>> I’m also thinking installation works here, not only timing critical live music.
>> m.
>>
>>> On Dec 30, 2016 17:34, "Michael Zacherl" <sdiy-mz01@xxxxxxxxxxxxx> wrote:
>>>
>>> On 30.Dec 2016, at 17:09 , Glen Fraser <holaglen@xxxxxxxxx> wrote:
>>>
>>>> Just out of curiosity, is it possible to receive on a TCP connection in SC? I know you can call “connect" on a NetAddr to connect with TCP (rather than UDP) and send messages on that connection…that much works for me. But TCP is bidirectional, and I can’t see any way to set up SC to receive messages on the TCP connection…the NetAddr has a raw pointer to the socket, which isn’t very useful in sclang. Is there any way to do this?
>>>
>>> I never used that things in SC, so just had a brief look at NetAddr.
>>> Looking at the example in the help doc, how’s that supposed to work?
>>> What’s going to listen on the TCP-Port?
>>>
>>> When doing
>>>
>>> n = NetAddr("127.0.0.1", 57120); // 57120 is sclang default port
>>> n.connect;
>>>
>>> it returns a “connection refused”, which appears conclusive to me.
>>> On Wireshark I can see an outgoing packet containing TCP trying to establish a connection which, of course,
>>> gets a “reset” as an answer.
--
http://mz.klingt.org
_______________________________________________
sc-users mailing list
info (subscription, etc.): http://www.birmingham.ac.uk/facilities/ea-studios/research/supercollider/mailinglist.aspx
archive: https://listarc.bham.ac.uk/marchives/sc-users/
search: https://listarc.bham.ac.uk/lists/sc-users/search/