Browse Source

devicechannel: receive need not return a packet

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

+ 3
- 4
src/devicechannel.vala View File

@ -98,7 +98,7 @@ class DeviceChannel : Object {
}
}
public async void receive(out Packet pkt) throws Error {
public async void receive() throws Error {
size_t line_len;
// read line up to newline
string data = yield _din.read_upto_async("\n", -1,
@ -110,7 +110,7 @@ class DeviceChannel : Object {
_din.read_byte();
_din.read_byte();
pkt = Packet.new_from_data(data);
Packet pkt = Packet.new_from_data(data);
if (pkt == null) {
critical("failed to build packet from data");
return;
@ -123,8 +123,7 @@ class DeviceChannel : Object {
debug("check for IO");
try {
debug("try read");
Packet pkt;
yield this.receive(out pkt);
this.receive();
} catch (Error e) {
critical("error occurred: %d: %s", e.code, e.message);


Loading…
Cancel
Save