[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [sc-users] TCP default?



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.

(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.)

Glen.

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.
_______________________________________________
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/