Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Porting old Delphi2007 application using TServerSocket....
#4
Turns out I was close then using IOHandler.ReadLn(ETX), I did not wait for the STX to arrive, though.
Can't I wait for ETX instead so I know a complete message is available?
I noted that the ReadLn will throw away the ETX char only returning the stuff before.

Regarding the OnExecute call, is there some minimum time between the invocations?

And do I actually have to check if there is data before issuing the ReadLn call? Can OnExecute be called without any data having arrived?
Is there a way to check how much data there is in queue before actually trying to read it?

I assume that if I just skip the ReadLn call the data stays in the buffer so the next time around new data arriving gets added to the end of the buffer and can be retrieved with a later ReadLn call?

I think it will not be a big problem but I have noted when testing that there seems to be a lag in the handling, for example when I connect the client it connects immediately as witnessed by activity in the OnConnect, where I print out the connection message on the console, yet it takes several seconds or more before the client app shows the login dialog to the user in preparation for actually logging in. It is raised as soon as the client discovers the connection succeeded.

Same when sending the login request it is immediately shown in the console but the client takes some time to discover that a valid login has been accepted even though my test code sends the reply immediately after the console has been written to.

So if this is caused by the OnExecute firing only at a leisurely rate I need to figure out a better way to discover incoming data arriving...
Reply


Messages In This Thread
RE: Porting old Delphi2007 application using TServerSocket.... - by BosseB - 07-06-2020, 11:19 PM

Forum Jump:


Users browsing this thread: 2 Guest(s)