in reply to POE and DBI

Hi,

You can easily make the approach using POE::Component::Server::TCP and POE::Component::SimpleDBI.

Having one tcp server session that listen to incoming connections, then you can use a hash-map to know to which db connect each of the clients. Then you have 2 DBI session, one for each databases, then when a input comes from the socket, you check the remote client to know to which session to forward the DBI call.

The hash-map is very simple, because you only need a map between remote-ip and dbi_session_name. For this map, I would suggest to create a config file using something like YAML.

As you see, the DBI connections are shared inside POE, so that you don't need to create more sessions or pools of dbi connections

Regards,

|fire| at irc.freenode.net