Can't Connect to Remote Server

Hello and apologies in advance for the length of my message. I hope I have provided all the necessary information, this is my first post!

I am trying to set up a remote server to communicate between two MacBooks on the same wifi network. The Apple firewall is disabled on both machines. I am running all the code in SC IDE 3.11.2 on both machines.

When I follow the instructions from the Server Guide:

// on machine running the server
(
s.options.protocol = \tcp; // set to use tcp
s.options.bindAddress = "0.0.0.0"; // allow connections from any address
s.options.maxLogins = 2; // set to correct number of clients
s.boot;
)

// on remote machine connecting to server
(
o = ServerOptions.new;
o.protocol_(\tcp);
t = Server.remote(\remote, NetAddr("192.168.1.70", 57120), o); // set to correct address and port
t.addr.connect;
t.startAliveThread( 0 );
t.doWhenBooted({ "remote tcp server started".postln; t.notify; t.initTree });
)

On the remote machine, I get the error:

NetAddr-Connect failed with exception: connect: Connection refused

After this error, I tried adding

o.bindAddress = "0.0.0.0";

to the remote machine’s code and setting the clientID to 1 with:

t = Server.remote(\remote, NetAddr("192.168.1.70", 57120), o, 1);

but I get the same error.

When I follow the instructions from Server Help File

// example usage:
// on machine running the server
(
s.options.bindAddress = "0.0.0.0"; // allow connections from any address
s.options.maxLogins = 2; // set to correct number of clients
s.boot;
)

// on remote machine connecting to server
(
o = ServerOptions.new;
o.options.maxLogins = 2;
t = Server.remote(\remote, NetAddr("192.168.1.70", 57120), o); // set to correct address and port
// info about returned client ID should be posted in the post window
t.makeWindow; // make a window for monitoring
)

the remote machine posts

remote: setting clientID to 0.
→ remote

However, if I try to run something like

{ SinOsc.ar(440, 0, 0.2) }.play(t);

I get this:

WARNING: server ‘remote’ not running.
→ nil

Even though the machine running the server has been booted with the code above.

I also tried manually changing the clientID to 1 in this case after my initial attempt failed but that didn’t change anything.

Finally, when I follow the instructions from Multi-Client Setups

// on the machine where scsynth runs, it can be the default server.
// set the maximum number of client logins expected:
s.options.maxLogins = 8;
// now reboot the server, so that it will have maxLogins
s.reboot;

// from another sclang instance, log into scsynth:
s.options.maxLogins = 8;
// example NetAddr of the machine that runs scsynth on standard port
s.addr = NetAddr("168.192.1.70", 57120);

I get:

WARNING: server ‘localhost’ not running
→ nil
You will have to manually boot remote server.

Again, the server has been booted on the other machine.

I tried enabling port forwarding on my router settings for port 57120 UDP and TCP and verified in every case that that is the port the SC IDE is using. I also tried turning off the firewall on my router.

I am working on this with a couple of friends, and we have tried on Raspbian, Windows and Mac machines and we get the same behavior in all cases, so I assume I am missing something basic. Any help would be greatly appreciated!

I think the port is the issue. 57120 is the port of sclang, not the server. The server is probably 57110. Look at the post window when you boot the server. Mine says:

Booting server ‘localhost’ on address 127.0.0.1:57110.

Sam

That’s exactly what the problem was. Thanks a lot for slogging through my long winded post! Changing the port number on the remote server did the trick!

Cheers!