Skip to content
This repository has been archived by the owner on Feb 22, 2020. It is now read-only.

Commit

Permalink
fix(socket): raise socket rec/send message exception
Browse files Browse the repository at this point in the history
  • Loading branch information
felix committed Sep 20, 2019
1 parent fc32930 commit 205962f
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions gnes/proto/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down Expand Up @@ -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.