I have a apache webserver, and we need to develop a module in it (using mod_python or mod_wsgi). It will ofcourse handle the requests sent as http GET/POST. However, we would like this module to ALSO handle messages sent by another remote applications which are NOT http based. That is, the body of the those tcp packets may just be a json or xml formatted message. That remote application just keeps spitting out notifications every once in a while and is not expecting any responses from the apache module.
I was wondering if I can spawn two threads in my module (one receiving messages from apache when http messages are received on port 80, the other thread listening on some other port .. say 2000 .. and my remote machine is configured to send to port 2000). Another possibility is that I run a separate application on my apache machine listening on port 2000. When it receives notification, I wrap it into http message and send it back to myself on port 80.
I guess the question is: Is my module limited to getting messages only via the apache (from port 80) or can my apache module also listen on other ports ? If there's a simpler solution, please let me know. Thanks.