Working on an application that requires arbitrary connections between any number of iPads and any number of apple tvs in a showroom. I’m using bonjour to handle all the service discovery and whatnot, and thought OSC might be the go for the actual command sending. There’s multiple channels of communication that need to happen which i thought OSC would be suited for.
/handshake/* for anything related to pairing,
/control/* to any control specific commands etc.
So i assume that the application will need both a
osc::SenderTcp and a
osc::ReceiverTcp to handle the incoming and outgoing messages. I can see that there’s a constructor for each of them that takes an externally created
TCPSocketRef but I can’t for the life of me get it to work. It probably doesn’t help that I know next to nothing about either asio or osc itself.
tcp::endpoint endpoint = tcp::endpoint ( asio::ip::address_v4::from_string ( "127.0.0.1" ), definition.Port ); // Tried 0.0.0.0 as well _tcpTransport = std::make_shared<tcp::socket>( App::get()->io_service() ); _tcpTransport->open( endpoint.protocol(), error ); _tcpTransport->bind( endpoint ); _receiver = std::make_unique<osc::ReceiverTcp>( _tcpTransport ); _sender = std::make_unique<osc::SenderTcp>( _tcpTransport, endpoint );
There’s an error upon construction that is sent to the callback, and then one upon each subsequent call to
_sender->send ( ... ) which is
Tcp Send: Socket is not connected - Code: 57
Am I missing something simple, or is this just not how OSC is intended to be used and I should write a custom communication layer directly on top of ASIO?