I noticed in server's tutorial that using printers should be placed in single-thread handlers of server.
I didn't pay much attention to this, and ended up with a print failure.
While the attached zip demonstrates the problem, I wonder whether there is a work-around without setting the single-thread option to true. For example if I could simpy place a call to the main module and initialize the print class from there.
You can use sockets in a multithreaded server. You should call StartMessageLoop to prevent the handler from completing before the Connected event was raised.
Call StopMessageLoop after the connection has close.
Indeed that solved the issue, thank you! However, I have another question: While in messageLoop, can other connections be established (server connections) or they will be blocked till we stopMessageLoop?
The message loop created only affects the current request (or thread). It will not have any effect on other requests. Note that in debug mode all requests are handled by the same thread so requests are handled sequentially.