Server::Obj::Obj( int port, Proto proto ) { string portStr = boost::lexical_cast< string >( port ); mThread = lo_server_thread_new_with_proto( ( port == PORT_ANY ) ? NULL : portStr.c_str(), proto, errorHandler ); if ( port == PORT_ANY ) mPort = lo_server_thread_get_port( mThread ); else mPort = port; lo_server_thread_start( mThread ); }
void *veejay_new_osc_server( void *data, const char *port ) { osc_recv_t *s = (osc_recv_t*) vj_malloc(sizeof( osc_recv_t)); s->st = lo_server_thread_new( port, error_handler ); lo_server_thread_start( s->st ); s->url = lo_server_thread_get_url( s->st ); s->port = lo_server_thread_get_port( s->st ); veejay_msg( 0, "OSC server '%s' ready",s->url ); return (void*) s; }
Server::Server( int port, Proto proto /* = PROTO_UDP */ ) { string portStr = boost::lexical_cast< string >( port ); mThread = lo_server_thread_new_with_proto( ( port == PORT_ANY ) ? NULL : portStr.c_str(), proto, errorHandler ); if ( port == PORT_ANY ) { mPort = lo_server_thread_get_port( mThread ); } else { mPort = port; } lo_server_thread_start( mThread ); }