Skip to content

Commit

Permalink
Merge pull request #213 from yannayl/patch-1
Browse files Browse the repository at this point in the history
Split connection creation and server logic
  • Loading branch information
coldfix committed May 29, 2017
2 parents 0ed7a97 + e3adefe commit 0f82f11
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion rpyc/utils/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -195,10 +195,14 @@ def _serve_client(self, sock, credentials):
conn = Connection(self.service, Channel(SocketStream(sock)),
config = config, _lazy = True)
conn._init_service()
conn.serve_all()
self._handle_connection(conn)
finally:
self.logger.info("goodbye [%s]:%s", h, p)

def _handle_connection(self, conn):
"""This methoed should implement the server's logic."""
conn.serve_all()

def _bg_register(self):
interval = self.registrar.REREGISTER_INTERVAL
self.logger.info("started background auto-register thread "
Expand Down

0 comments on commit 0f82f11

Please sign in to comment.