diff options
| author | Loic Guegan <manzerbredes@mailbox.org> | 2022-07-01 10:03:54 +0200 |
|---|---|---|
| committer | Loic Guegan <manzerbredes@mailbox.org> | 2022-07-01 10:03:54 +0200 |
| commit | 1eee1ac81a0ef7f86c7acc2d431b0ac084aebf14 (patch) | |
| tree | 7c96d65453044eaf4edb1db551181b79cfeaae71 /esds/node.py | |
| parent | 48ca1f43f20518949bacd86a59c6cbc38e4a7408 (diff) | |
Change API. Indeed, currently wired communications
are aborted when receiver node turned off. This
may not be desire when implementing UDP communications.
Now user can use a boolean when using send()/sendt() to change this
behavior.
Diffstat (limited to 'esds/node.py')
| -rw-r--r-- | esds/node.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/esds/node.py b/esds/node.py index 4c9ca5f..09569a0 100644 --- a/esds/node.py +++ b/esds/node.py @@ -100,7 +100,7 @@ class Node: self["state"]="call_non_blocking" self.wait_ack(["turn_on"]) - def send(self, interface, data, datasize, dst): + def send(self, interface, data, datasize, dst,cancel_on_turn_off=True): if interface not in self["interfaces"]: self.abort("send() called with an unknown interface \""+interface+"\"") elif type(datasize) != int and type(datasize) != float: @@ -110,14 +110,14 @@ class Node: elif not self["turned_on"]: self.abort("send() called while node is turned off") self.plugin_notify("send_call",(interface,data,datasize,dst)) - self.rargs=(interface, data, datasize, dst) + self.rargs=(interface, data, datasize, dst,cancel_on_turn_off) self["request"]="send" self["state"]="call_blocking" ack=self.wait_ack(["send","send_cancel"]) self.plugin_notify("send_return",(interface,data,datasize,dst,ack[1])) return ack[1] - def sendt(self, interface, data, datasize, dst, timeout): + def sendt(self, interface, data, datasize, dst, timeout,cancel_on_turn_off=True): if interface not in self["interfaces"]: self.abort("sendt() called with an unknown interface \""+interface+"\"") elif type(datasize) != int and type(datasize) != float: @@ -134,7 +134,7 @@ class Node: self["request"]="timeout_add" self["state"]="call_non_blocking" self.wait_ack(["timeout_add"]) - self.rargs=(interface, data, datasize, dst) + self.rargs=(interface, data, datasize, dst,cancel_on_turn_off) self["request"]="send" self["state"]="call_blocking" ack=self.wait_ack(["send","timeout","send_cancel"]) |
