Browse Source

devicechannel: catch connect error

bboozzoo/device-cache
Maciek Borzecki 10 years ago
parent
commit
f4071f77da
1 changed files with 10 additions and 1 deletions
  1. +10
    -1
      src/devicechannel.vala

+ 10
- 1
src/devicechannel.vala View File

@ -42,7 +42,16 @@ class DeviceChannel : Object {
assert(this._isa != null);
var client = new SocketClient();
_conn = yield client.connect_async(_isa);
try {
_conn = yield client.connect_async(_isa);
} catch (Error e) {
//
critical("failed to connect to %s:%u: %s",
_isa.address.to_string(), _isa.port,
e.message);
return;
// TODO emit disconnected signal?
}
debug("connected to %s:%u", _isa.address.to_string(), _isa.port);


Loading…
Cancel
Save