OfxOscSenderReceiver Error

Hello there.

I am experimenting a project that have ofxOsc involved as well as OpenNI2. When I run a code. I got this error :

socket is a private member of OfxSender
listen_socket is a private member of OfxReceiver

I use Supercollider osc to OF.

I’m running on Mac os x 10.9.2. Xcode Version 5.1.1 (5B1008)

Anybody has any suggestions ? I would be appreciated


You should access socket and listen_socket through the ofxOscSender/Receiver accessor methods, not directly.

Maybe post a code snippit here…?

Hi gwydion,

Thank you so much for the quick response. So sorry I wasn’t clear at first. Here is a code :

#include "ofxOscSenderReceiver.h"

void ofxOscSenderReceiver::setup(int listen_port, string send_host, int send_port)
	this->socket = (UdpTransmitSocket *) listen_socket;
	ofxOscSender::setup(send_host, send_port);


Am a bit confused - I use the ofxOsc add-on in my project and use the ofxOscReceiver and ofxOscSender classes fine. But I have never seen ofxOscSenderReceiver before - is this a new class you are writing? Have you already tried using the existing ofxOscReceiver and ofxOscSender classes separately in your app?


I found some doc about ofxSuperCollider: https://code.google.com/p/ofxsupercollider/source/browse/trunk/ofxSuperCollider/src/ofxSCServer.cpp.
At first sight, ofxOscSenderReceiver might be out-of-date with ofxOsc. Probably, some inherited members used to be protected but are now private or so. Anyway, if you look the the following code, you can see that there is an alternative:

ofxSCServer::ofxSCServer(string hostname = "localhost", unsigned int port = 57110)
    this->hostname = hostname;
    this->port = port;

    osc.setup(LISTEN_PORT, hostname, port);
    ofAddListener(ofEvents.draw, this, &ofxSCServer::_process);
    osc.setup(hostname, port);

Without having dug deeper, I’m pretty sure that you can compile your code without ofxOscSenderReceiver.
Just un-define the macro or remove the file from your project.

Hope it helps!