the on_disconnect is called when the connection is closed. the server and the client don't communicate with each other,
except for the normal flow of TCP -- when one side closes the writing (sends FIN), the other side recv() an empty buffer,
which tells it the stream has ended, so rpyc closes it, and the finalization code is invoked.
why do you want to *start* the server and then do initialization?
for pathological cases, you can derive a new class from it, say
class MyThreadedServer(ThreadedServer):
...
and place initialization code in __init__. but why? today, the code for creating a server looks like so:
s = ThreadedServer(....parameters....)
s.start()
so either you place your code between the two lines, or invoke s.start() on a thread.
but since we're talking about a *server*, does it not make sense for it block?
btw, you can always call s.close() (also invoked by SIGINT) to terminate the server cleanly.
hope this helps,
-tomer
An NCO and a Gentleman