From 69d8b0395fd15c1d57d42aaeeb0c6d5da8294496 Mon Sep 17 00:00:00 2001 From: Philipp Klaus Date: Wed, 18 Oct 2017 23:55:52 +0200 Subject: [PATCH] brother_ql_print network backend timeout fix (#23) --- brother_ql/backends/network.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/brother_ql/backends/network.py b/brother_ql/backends/network.py index 8fd13eb..a7e1ec9 100755 --- a/brother_ql/backends/network.py +++ b/brother_ql/backends/network.py @@ -63,7 +63,9 @@ class BrotherQLBackendNetwork(BrotherQLBackendGeneric): raise NotImplementedError('Currently the printer can be specified either via an appropriate string or via an os.open() handle.') def _write(self, data): - self.s.send(data) + self.s.settimeout(10) + self.s.sendall(data) + self.s.settimeout(self.read_timeout) def _read(self, length=32): if self.strategy in ('socket_timeout', 'try_twice'):