TCP OSC issue between two computers


#1

Hi,

I’m trying to connect two computers using osc with tcp using the SimplerReceiver and SimpleSender samples.

Sending with udp works fine. Sending and receiving with tcp on same computer also works fine.
But receiving in one computer and sending from the other with tcp does not work, and I don’t seem to figure it out why.

The sender connects and quits when trying to send the first message.

./Debug/OSC-SimpleSender/OSC-SimpleSender.app/Contents/MacOS/OSC-SimpleSender
|verbose| auto SimpleSenderApp::setup()::(anonymous class)::operator()(asio::error_code) const[70] Connected
|error  | void SimpleSenderApp::onSendError(asio::error_code)[86] Error sending: Broken pipe val: 32

The sender is a macOS computer and the receiver is a linux one, but it probably does not matter.

Would be grateful for any ideas.

-Gabor


Osc udp receiving on another computer problem
#2

Hi Gabor,

Sorry that’s happening to you. I see it on my side. I’ll dig deeper and post my findings tonight.

Best,
Ryan Bartley


#3

Found the problem, which is more of a ‘feature’ :). In essence, the accept function returns a boolean. That boolean tells the OSC block’s subsystem whether or not to accept the connection. If you don’t care who connects, just return true; in your accept function. The SimpleReceiver app has a variable when it’s initializing the TcpReceiver called expectedOriginator and the value passed in is “127.0.0.1”, which is local host and the reason the sample won’t work across the network. Either change that to the endpoint your waiting to accept from or just return true from that function. Let me know if that solves your problem.

Best,
Ryan Bartley


#4

Thanks Ryan! Works well.

I tried changing the expectedOriginator ip before, but I probably mistyped the ip address. Returning true in the accept handler solves this. Thank you.