Hello all and Bruce,
a while ago I wrote a Simple-client-simple-server-combo that kept the connection open by sending signals back and forth to trick the time-out. It was sort of Long Polling.
Now I would like to re-write that combo, but as a webserver. There will be several webclients that will keep connection with the server as in the previous project with the simple-server/client.
Two questions ar on my mind:
Where / in which embed/method do I collect and store the IP-Addresses of the clients? I tested several embed, learned that .MakePage gets triggered only one time. Other embeds get hit more often, but actualy it doesn't matter that much as I could eliminate duplicate entries. I'd just like to know the "legal" one, not one that just works accidently ;-)
The other question: where to store? My idea is to use an IMDD-file.
I understood so far, that each request is processed by the server in a separate thread. That would mean, if 3 clients connect to the server, I get 3 tables with just one record, and as the thread ends within a second, each table is gone after that peticular second.
During my tests so far I played with a global queue. This one seems to be persistent.
And a third question came to my mind: in the simple-combo I stored the socket and sock-id, beside the IP. I guess the webserver handles and hides socket/sock-id from me, so I would simply send data back to the raw IP-Address?
I am curios how it would work with proxies. But first I have to get it going.....
Thanks for any input,
Wolfgang