Hi Alberto,
>> Ok, understood, then it is not a big problem to deal with many sockets, suppose a 1000 clients,
>> what type of server and connection bandwidth do you need?
A typical Windows Server machine can do upwards of 20 000 sockets (maybe as many as 65000 sockets - I haven't been able to test that) so 1000 is no problem.
CPU requirements and bandwidth is completely dependent on what you are doing - how often you are sending data, how much data you are sending and so on. Usually I start small and monitor usage and increase as required.
>> And how do I implement this kind of job with sockets in NT8?
Sockets are in NT9, not NT8, so it would be a lot of work to implement sockets in NT8. (You'd basically have to write a web socket class, and that's not trivial to do.)
>>-The client opens a socket and inform the server what it needs.
>>-The server keeps this need till it has anything to send to the client (loop)
>>-The server sends something to the client which uses it (merely to refresh a browse) and inform the server its still alive and waiting for more.
>> Can it be done?
Can it be done? Sure anything can be done given sufficient time. But it would be a non-trivial amount of work. I don't know the exact mechanism since I've not implemented that myself, but you'd need to end threads without ending the connection, maintaining a list of them, and who is waiting for what, and then have a mechanism for pushing data to those threads. I think it would be a lot of work to do.
Implementing the WebSockets (which is basically the same idea) was a fair bit of work and also lead to the need for Host variables (ie data shared between users) - plus of course all the connection management etc. You can't just "stall" a thread waiting, because it's highly unlikely that you can have 1000 threads in an app (just from a RAM perspective.)
Your best bet (and your cheapest), by a long way, is to just upgrade to NT9 and make use of the WebSocket support that is already there.
cheers
Bruce