summaryrefslogtreecommitdiffstats
path: root/src/engine
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2011-04-19 20:41:24 +0000
committerDavid Robillard <d@drobilla.net>2011-04-19 20:41:24 +0000
commitc9683eb916ff52ab6907773360c655d776b24f23 (patch)
tree39696902060bf6b3dbba156c1d315f4e69f7ce28 /src/engine
parent6ec78b5a9eb499646d7fa6ccb306378426008e9d (diff)
downloadingen-c9683eb916ff52ab6907773360c655d776b24f23.tar.gz
ingen-c9683eb916ff52ab6907773360c655d776b24f23.tar.bz2
ingen-c9683eb916ff52ab6907773360c655d776b24f23.zip
Make maximum UDP packet size a runtime parameter (--packet-size, -k).
git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@3170 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/engine')
-rw-r--r--src/engine/OSCClientSender.hpp6
-rw-r--r--src/engine/OSCEngineReceiver.cpp9
2 files changed, 10 insertions, 5 deletions
diff --git a/src/engine/OSCClientSender.hpp b/src/engine/OSCClientSender.hpp
index a30deb15..6ce8d684 100644
--- a/src/engine/OSCClientSender.hpp
+++ b/src/engine/OSCClientSender.hpp
@@ -41,8 +41,10 @@ class OSCClientSender : public ClientInterface,
public Ingen::Shared::OSCSender
{
public:
- explicit OSCClientSender(const Raul::URI& url)
- : _url(url)
+ explicit OSCClientSender(const Raul::URI& url,
+ size_t max_packet_size)
+ : Shared::OSCSender(max_packet_size)
+ , _url(url)
{
_address = lo_address_new_from_url(url.c_str());
}
diff --git a/src/engine/OSCEngineReceiver.cpp b/src/engine/OSCEngineReceiver.cpp
index bf03b29d..59aac9e4 100644
--- a/src/engine/OSCEngineReceiver.cpp
+++ b/src/engine/OSCEngineReceiver.cpp
@@ -300,7 +300,9 @@ OSCEngineReceiver::_register_client_cb(const char* path, const char* types, lo_a
lo_address addr = lo_message_get_source(msg);
char* const url = lo_address_get_url(addr);
- ClientInterface* client = new OSCClientSender((const char*)url);
+ ClientInterface* client = new OSCClientSender(
+ (const char*)url,
+ _engine.world()->conf()->option("packet-size").get_int32());
register_client(client);
free(url);
@@ -602,12 +604,13 @@ OSCEngineReceiver::unknown_cb(const char* path, const char* types, lo_arg** argv
const lo_address addr = lo_message_get_source(msg);
char* const url = lo_address_get_url(addr);
- warn << "Unknown OSC command " << path << " (" << types << ")" << endl;
+ warn << "Unknown OSC command " << path << " (" << types << ") "
+ << "received from " << url << endl;
string error_msg = "Unknown command: ";
error_msg.append(path).append(" ").append(types);
- OSCClientSender(url).error(error_msg);
+ lo_send(addr, "/error", "s", error_msg.c_str(), LO_ARGS_END);
free(url);
return 0;