#include <glib.h>
#include <btio/btio.h>
+#include "log.h"
#include "sdp-client.h"
/* Number of seconds to keep a sdp_session_t in the cache */
{
sdp_session_t *s;
GIOChannel *chan;
+ uint32_t prio = 1;
+ int sk;
if (!ctxt)
return -EINVAL;
(*ctxt)->session = s;
(*ctxt)->uuid = *uuid;
- chan = g_io_channel_unix_new(sdp_get_socket(s));
+ sk = sdp_get_socket(s);
+ /* Set low priority for the SDP connection not to interfere with
+ * other potential traffic.
+ */
+ if (setsockopt(sk, SOL_SOCKET, SO_PRIORITY, &prio, sizeof(prio)) < 0)
+ warn("Setting SDP priority failed: %s (%d)",
+ strerror(errno), errno);
+
+ chan = g_io_channel_unix_new(sk);
(*ctxt)->io_id = g_io_add_watch(chan,
G_IO_OUT | G_IO_HUP | G_IO_ERR | G_IO_NVAL,
connect_watch, *ctxt);