Hello,
I need to redesign a service (environmental control) and wondering, whether POE might be the right choice. My SERVER will be connected by up to 25 CLIENTS and 3 MONITORS. CLIENTS are each connected to several local RESSOURCES. They are sending information to the server and are waiting for responses, while the SERVER does DB queries, logging . MONITORS are also clients to the SERVER, but they are processing calculations upon information in the DB. They are currently using different TCP ports, which is OK. MONITORS will sometimes have to send Information to RESSOURCES but they have to use the SERVERs established TCP connection to the CLIENTS, which is in charge of the specific RESSOURCE. I'm getting watchdog packets from the CLIENT to the SERVER per RESSOURCE on a regular basis. In my current design (none POE), on the SERVER, I'm using this watchdog packets to lookup the DB, if there are information to be fired to the RESSOURCE. I am able to get the watchdogs at a rate of minimum every 30s per RESSOURCE which leads to a worse delay of 30+s to get the information to the RESSOURCE and believe me, strangers can d a lot within 30s. Also, as I'm currently forking my program per CLIENT connection, it is hard to get information from one client to another. I'm wondering, whether POE is the right solution for this. About the CLIENT connect: I have been able to port my SERVER to POE, using the "SocketFactory and ReadWrite " example from the Cookbook, which has been much less effort, that expected ;-) My question: 1. Connecting MONITORS: How would I start a second listener, using another port, doing other stuff, if it will get information from a MONITOR process? 2. How would the POE Session (connected to a MONITOR) find the POE Session, connected to a specific CLIENT, locally connected to the RESSOURCE, to pass the information to? 3. How my I drop information into the TCP connection to the Client. like "$heap->{socket_wheel}->put("id:765,evnt:lock");"? Put might be OK, but who to address the session? I found the IKC example. Would it be a good idea, to address the RESSOURCE from the MONITOR using post_respond? Again: what would I have to prepare in the SERVER, to get a service for my RESSOURCE:765 to 'lock' it? Any hint or advice is highly appreciated. Thank You Regards Stefan