From 361b9a1d78f9b25378e62e64650aee924b70f13e Mon Sep 17 00:00:00 2001 From: Maciek Borzecki Date: Sat, 17 Jan 2015 23:28:29 +0100 Subject: [PATCH] devicechannel: receive need not return a packet --- src/devicechannel.vala | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/devicechannel.vala b/src/devicechannel.vala index 5d4af8b..d5d52f4 100644 --- a/src/devicechannel.vala +++ b/src/devicechannel.vala @@ -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);