Skip to content

Commit

Permalink
Only close socket once.
Browse files Browse the repository at this point in the history
  • Loading branch information
dickensc committed Aug 24, 2023
1 parent 26c2753 commit 58b996a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions psl-python/pslpython/deeppsl/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
ENCODING = 'utf-8'
MAX_MESSAGE_SIZE_BYTES = 2 ** 14


class ConnectionHandler(object):
def __init__(self):
self._model = None
Expand Down Expand Up @@ -206,8 +207,6 @@ def main(port):

keep_open = handler.handle_request(connection, data)
if not keep_open:
connection.shutdown(socket.SHUT_RDWR)
sock.shutdown(socket.SHUT_RDWR)
break

connection.close()
Expand All @@ -224,5 +223,6 @@ def _load_args(args):

return int(args.pop(0))


if __name__ == '__main__':
main(_load_args(list(sys.argv)))
main(_load_args(list(sys.argv)))

0 comments on commit 58b996a

Please sign in to comment.