I've set up a pretty generic bidirectional client (straight out of the Perl Cookbook, recipe 17.10) and forking server (using IO::All). Both sides use IO::Socket (IO::All is providing a front end to IO::Socket here.)
I'd like to able to terminate a client, and have a later instance of the client reconnect to a specific child process of the original server that the previous instance had been connected to.
My best thought so far is that I need to have the server child process open a socket on a new port, pass the port # back to the client, and close the old port; when the child gets the new port number, it closes the old socket, and opens a new one on the new port, storing the port # where later instances of itself can get to it.
Is there a smarter way to do this? Could it be done leaving the parent and children servers on one port and having the parent somehow magically forward its connection to a specific child based on info the child had previously passed back to the client?
Sorry for the vagueness of the questions -- I'm new to socket programming and trying to learn what's possible.
In reply to Reconnecting to a specific child of a forking server by Zed_Lopez
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |