Skip to content
Permalink
Browse files

fix(socket): raise socket rec/send message exception

  • Loading branch information...
numb3r3 committed Sep 20, 2019
1 parent fc32930 commit 205962fb9ee509b895b68a3a9d30c399bb6db42b
Showing with 4 additions and 0 deletions.
  1. +4 −0 gnes/proto/__init__.py
@@ -134,6 +134,8 @@ def send_message(sock: 'zmq.Socket', msg: 'gnes_pb2.Message', timeout: int = -1)
'cannot send message to sock %s after timeout=%dms, please check the following:'
'is the server still online? is the network broken? are "port" correct? ' % (
sock, timeout))
except Exception as ex:
raise ex
finally:
sock.setsockopt(zmq.SNDTIMEO, -1)

@@ -185,5 +187,7 @@ def recv_message(sock: 'zmq.Socket', timeout: int = -1, check_version: bool = Fa
'no response from sock %s after timeout=%dms, please check the following:'
'is the server still online? is the network broken? are "port" correct? ' % (
sock, timeout))
except Exception as ex:
raise ex
finally:
sock.setsockopt(zmq.RCVTIMEO, -1)

0 comments on commit 205962f

Please sign in to comment.
You can’t perform that action at this time.