From 9ca7a1833822d9d99d9445843d084ebf17353cf0 Mon Sep 17 00:00:00 2001 From: Maciek Borzecki Date: Sat, 2 Jul 2016 22:41:47 +0200 Subject: [PATCH] devicechannel: use Socket.create_socket_source() helper Calling Socket.create_source() will generate a C call to g_socket_datagram_based_create_source(), and that returns null for TCP sockets. Use a helper Socket.create_socket_source() method to workaround this problem.. --- src/mconnect/devicechannel.vala | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/mconnect/devicechannel.vala b/src/mconnect/devicechannel.vala index fcb72fc..b065dda 100644 --- a/src/mconnect/devicechannel.vala +++ b/src/mconnect/devicechannel.vala @@ -108,9 +108,7 @@ class DeviceChannel : Object { // enable keepalive sock.set_keepalive(true); // prep source for monitoring events - var source = (SocketSource) sock.create_source(IOCondition.IN - | IOCondition.ERR - | IOCondition.HUP); + var source = sock.create_socket_source(IOCondition.IN); source.set_callback((src, cond) => { this._io_ready.begin(cond); return true;