Jump to content
ertank

TWSocketServer, TWSocketClient.OnDataAvailable tiggers without any data

Recommended Posts

Hello,

 

I am using v8.71 of ICS. There is a device connecting to my application and sending some data. So, I basically wait for a connection and communicate with that device both ways.

Occationally, TWSocketClient.OnDataAvailable event triggers even if there is no data ( aka GetRcvdCount = -1)

 

I just wonder if this is normal and what might be possible reasons?

 

Thanks & Regards,

Ertan

Edited by ertank

Share this post


Link to post

Yes, this is normal behaviour, better to have DataAvailable trigger too often than miss potential data.  Sorry, can not tell you why it was designed that way 25 years ago...

 

Angus

 

Share this post


Link to post

AFAIR GetRcvdCount was marked as not 100% proof somewhere in the code and it was always recommended to try Recv in trigger.

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×