Hi MC,

Short some thoughts, maybe they can help you on the way.

Since ICS is async, all socket handling is done in the same thread, that means it will always be done serial and not parallel. Therefor there is no real need to put stuff in a thread list. If you receive information from a device which should be sent to another device, you can simply lookup the socket of that device and sent the information at that time (unless there is really a lot of data and you want to manage the queuing yourself).
In this respect things are a lot easier using ICS in stead of Indy.

Merijn

On 7/12/2016 19:14, MC Potgieter wrote:
I'm currently using Indy to communicate with TCP/IP devices. We have about
30000 devices and growing. We're getting to the point where the number of
concurrent connections are too many too handle for a single Indy server
instance. I have to start looking at load balancing but before I do that I
want to have a look a asynchronous sockets.

In extreme cases we have about 3000 concurrent connections but Indy can't
cope with that so we limit it to 1000 and queue the remainder.

My system was designed in such a way that devices can communicate with each
other through the TCP server. Whenever a device has information for another
device, the information is placed in a thread list from where the other
device will periodically check the thread list to see if there is any
information for it. If there is any information for it, it will read it
from the thread list and then write it to its socket.

Coming from Indy, each socket is in its own thread and therefore its easy
for a device to periodically check the thread list for new information.  I
also use the thread to determine the idle time of a socket and close the
socket if its been idling for too long.

ICS is more event driven and a like this but how do I go about checking the
thread list periodically?
I've been looking at a timer with a message pump but can't seem to get it
working.

Thanks in advance.

MC


--
To unsubscribe or change your settings for TWSocket mailing list
please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be

Reply via email to