Browse Source

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..
bboozzoo/socket-source
Maciek Borzecki 9 years ago
parent
commit
9ca7a18338
1 changed files with 1 additions and 3 deletions
  1. +1
    -3
      src/mconnect/devicechannel.vala

+ 1
- 3
src/mconnect/devicechannel.vala View File

@ -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;


Loading…
Cancel
Save