/*
- Copyright (C) 2012 Paul Davie
+ Copyright (C) 2012 Paul Davis
+
+ Using code from Rui Nuno Capela's qmidinet as inspiration.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
}
int
-IPMIDIPort::write (byte* msg, size_t msglen, timestamp_t /* ignored */) {
+IPMIDIPort::write (const byte* msg, size_t msglen, timestamp_t /* ignored */) {
if (sockout) {
- if (::sendto (sockout, (char *) msg, msglen, 0, (struct sockaddr *) &addrout, sizeof(struct sockaddr_in)) < 0) {
+ Glib::Threads::Mutex::Lock lm (write_lock);
+ if (::sendto (sockout, (const char *) msg, msglen, 0, (struct sockaddr *) &addrout, sizeof(struct sockaddr_in)) < 0) {
::perror("sendto");
return -1;
}
}
int
-IPMIDIPort::read (byte* buf, size_t bufsize)
+IPMIDIPort::read (byte* /*buf*/, size_t /*bufsize*/)
{
/* nothing to do here - all handled by parse() */
return 0;