ofxOscSender OutOfBufferMemoryException

Hi all
i am using an OSC sender to send the outline of blobs to another pc.

the relevant code is

void ofApp::sendBlobOutlines(ofxOscMessage *m)
{
    m->addIntArg( blobTr.size() );
    //for all outlines
    for ( unsigned int i = 0 ; i < blobTr.size() ; i++ )
    {
        //for all points in each outline
        vector<ofPoint> ptsInPolyline = blobTr[i].getVertices();
        m->addIntArg( ptsInPolyline.size() );
        for ( unsigned int k = 0 ; k < ptsInPolyline.size() ; k++ )
        {
            m->addFloatArg( ptsInPolyline[k].x );
            m->addFloatArg( ptsInPolyline[k].y );
        }
    }
} 

this raises an exception:
terminate called after throwing an instance of ‘osc::OutOfBufferMemoryException’
what(): out of buffer memory

and probably the reason is that the outlines are huge vectors of points.
I can simplify the polylines before sending them, but this does not mean i won’t get a crash if one more object comes into view - and so more points will be appended to the msg list that willexceed the buffer size…

Alternatively, i’d prefer to be able to extend the buffer size…
What can i do about this problem?

Thank you very much for your help!

Some clues of the limits can be seen in the OSC addon source, ofxOscSender::sendBundle:

void ofxOscSender::sendBundle( ofxOscBundle& bundle )
{
	static const int OUTPUT_BUFFER_SIZE = 32768;
	char buffer[OUTPUT_BUFFER_SIZE];
	osc::OutboundPacketStream p(buffer, OUTPUT_BUFFER_SIZE );
	…

and ofxOscSender::sendMessage:

void ofxOscSender::sendMessage( ofxOscMessage& message )
{
	static const int OUTPUT_BUFFER_SIZE = 16384;
	char buffer[OUTPUT_BUFFER_SIZE];
    osc::OutboundPacketStream p( buffer, OUTPUT_BUFFER_SIZE );
	…

you should simplify the blobs and send them one by one in a message for each, it’s not a very good idea to send such big messages thorugh osc: since it works over udp it’ll probably drop your messages for being to big anyway

@arturo could I assume that the reason for this is the udp protocol that drops packages?

if I want to send all my polyline without simplification , should I switch to tcp protocol ?