I'm using TWSocketServer to handle multiple incoming connections from a client's embedded unit.

Unfortunately the remote unit has a few limitations; the main one being that it can establish an IP connection to a server but cannot send data until the server requests it.

This means that although the OnClientConnect function gets called, the OnDataAvailable does not.

I had put a line of code in the OnClientConnect to trigger the OnDataAvailable function
but this seems to be blocking other connections.

You should not do that. OnDataAvailable is triggered when the other side has sent data.

My questions are:-
i) Is there a way to trigger the OnDataAvailable function by post a message on the socket.

No way. Well, no way that has real meaning.

ii) Is there a better way to do this without going to a threaded model.

No need to go multithreaded. You said: "cannot send data until the server requests it". This is the solution: once the embedded unit is connected send the request it waits. Probably the banner property is the place where you could place you request because banner is what the server component sent immediately when a client connect.

BTW and for my information, what kind of unit is this and what kind of request does it needs ?

The author of the freeware multi-tier middleware MidWare
The author of the freeware Internet Component Suite (ICS)

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