Browse Source

devicechannel: close channel method

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

+ 17
- 1
src/devicechannel.vala View File

@ -34,6 +34,7 @@ class DeviceChannel : Object {
private SocketConnection _conn = null;
private DataOutputStream _dout = null;
private DataInputStream _din = null;
private uint _srcid = 0;
// channel encryption method
private Crypt _crypt = null;
@ -75,11 +76,26 @@ class DeviceChannel : Object {
return true;
});
// attach source
source.attach(null);
_srcid = source.attach(null);
connected();
}
public async void close() {
debug("closing connection");
if (_srcid > 0) {
Source.remove(_srcid);
_srcid = 0;
}
_din.close();
_dout.close();
_conn.close();
_din = null;
_dout = null;
_conn = null;
}
/**
* send:
* Possibly blocking


Loading…
Cancel
Save