Thanks, I think that does it for me!
And there are never many clients connected, normally 0 or 1 but I have set a max of 2 clients.
Now I must rip out the old code and insert the new IdTCP server in its place...
But one clarification concerning the OnExecute handler:
If readln timeouts will it return an empty string to msg? I.e. it will leave the data in the buffer until the line ending char arrives?
I don't want to have partial packets to deal with...
I guess it must work that way because otherwise one can never know if a partial packet is present when processing it (the ETX char is "eaten" by ReadLn)...
And there are never many clients connected, normally 0 or 1 but I have set a max of 2 clients.
Now I must rip out the old code and insert the new IdTCP server in its place...
But one clarification concerning the OnExecute handler:
If readln timeouts will it return an empty string to msg? I.e. it will leave the data in the buffer until the line ending char arrives?
I don't want to have partial packets to deal with...
Code:
msg := AContext.Connection.IOHandler.ReadLn(ETX, 10); //Timeout 10 ms
I guess it must work that way because otherwise one can never know if a partial packet is present when processing it (the ETX char is "eaten" by ReadLn)...