Example #1
0
int main(unsigned int argc, char* argv[])
{
	int err;
	pthread_t lp2osc_thread, osc2lp_thread;
	
    // Launchpad initialization
    lp = lp_register();
	
	// OSC initialization
	osc = lo_server_new(port, error_handler);
	printf("port: %d\n", lo_server_get_port(osc));
	fflush(stdout);
		
	err = pthread_create(&lp2osc_thread, NULL, lp2osc, NULL);
	if (err){
		fprintf(stderr, "failed to start lp2osc thread, with error %d", err);
		return 0;
	}

	err = pthread_create(&osc2lp_thread, NULL, osc2lp, NULL);
	if (err){
		fprintf(stderr, "failed to start osc2lp thread, with error %d", err);
		return 0;
	}
	
    pthread_join(lp2osc_thread, NULL);
    pthread_join(osc2lp_thread, NULL);
	
	lp_deregister(lp);
	lo_server_free(osc);
	
    return 0;
}
Example #2
0
void sosc_zeroconf_register(sosc_state_t *state, const char *svc_name)
{
	if (!sosc_dnssd_registration_func)
		return;

	sosc_dnssd_registration_func(
		/* sdref          */  &state->ref,
		/* interfaceIndex */  0,
		/* flags          */  0,
		/* name           */  svc_name,
		/* regtype        */  "_monome-osc._udp",
		/* domain         */  NULL,
		/* host           */  NULL,
		/* port           */  htons(lo_server_get_port(state->server)),
		/* txtLen         */  0,
		/* txtRecord      */  NULL,
		/* callBack       */  mdns_callback,
		/* context        */  NULL);
}
Example #3
0
int lo_server_thread_get_port(lo_server_thread st)
{
    return lo_server_get_port(st->s);
}
Example #4
0
unsigned int OscReceiver::getPort()
{
	return m_serverThread ? (unsigned int) lo_server_get_port(lo_server_thread_get_server(m_serverThread)) : 0;
}
Example #5
0
int NonBlockOSCServer::getPort()
{
  return lo_server_get_port( server );
}