diff options
author | David Robillard <d@drobilla.net> | 2008-08-19 20:09:49 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2008-08-19 20:09:49 +0000 |
commit | 174bd3e0314785a1a885877a9efe7a7eef31e0fa (patch) | |
tree | 8368487dfb6e98de7cca2300ad0157868e29aaf4 /src/libs/shared/OSCSender.cpp | |
parent | e16206982d074e62956de00eeef611478f01c430 (diff) | |
download | ingen-174bd3e0314785a1a885877a9efe7a7eef31e0fa.tar.gz ingen-174bd3e0314785a1a885877a9efe7a7eef31e0fa.tar.bz2 ingen-174bd3e0314785a1a885877a9efe7a7eef31e0fa.zip |
Slightly more reliable OSC comms. Still not really up to the task of receiving massive patches...
git-svn-id: http://svn.drobilla.net/lad/ingen@1448 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/libs/shared/OSCSender.cpp')
-rw-r--r-- | src/libs/shared/OSCSender.cpp | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/src/libs/shared/OSCSender.cpp b/src/libs/shared/OSCSender.cpp index 3936cf96..f0cd76f2 100644 --- a/src/libs/shared/OSCSender.cpp +++ b/src/libs/shared/OSCSender.cpp @@ -18,6 +18,7 @@ #include "OSCSender.hpp" #include <cassert> #include <iostream> +#include <unistd.h> using namespace std; @@ -37,7 +38,9 @@ void OSCSender::bundle_begin() { assert(!_transfer); - _transfer = lo_bundle_new(LO_TT_IMMEDIATE); + lo_timetag t; + lo_timetag_now(&t); + _transfer = lo_bundle_new(t); _send_state = SendingBundle; } @@ -53,7 +56,9 @@ void OSCSender::transfer_begin() { assert(!_transfer); - _transfer = lo_bundle_new(LO_TT_IMMEDIATE); + lo_timetag t; + lo_timetag_now(&t); + _transfer = lo_bundle_new(t); _send_state = SendingTransfer; } @@ -99,13 +104,15 @@ OSCSender::send_message(const char* path, lo_message msg) if (!_enabled) return; - + if (_transfer) { + lo_timetag t; if (lo_bundle_length(_transfer) + lo_message_length(msg, path) > MAX_BUNDLE_SIZE) { - if (_send_state == SendingBundle) + //if (_send_state == SendingBundle) cerr << "WARNING: Maximum bundle size reached, bundle split" << endl; lo_send_bundle(_address, _transfer); - _transfer = lo_bundle_new(LO_TT_IMMEDIATE); + lo_timetag_now(&t); + _transfer = lo_bundle_new(t); } lo_bundle_add_message(_transfer, path, msg); |