Hi Wilfried,
> It is normal that you receive an empty string once a while. Just exit
> the OnDataAvailable event in that case. When data is really ready to
> receive OnDataAvailable will fire again.
I see your point - the other day I got the same result over and over again,
today the same code works fine. I'll have to remember to build "retry"
functionality into the system :)
BTW, just to clarify what was happening the other day, the following result
would end up with the variable 'msg' having data:
void __fastcall MyClass::ClientDataAvailable(TObject *Sender, WORD ErrCode)
{
AnsiString msg = ((TWSocketClient*) Sender)->ReceiveStr();
}
Whereas this code would result in the variable msg being empty:
void __fastcall MyClass::ClientDataAvailable(TObject *Sender, WORD ErrCode)
{
TWSocketClient* Client = dynamic_cast<TWSocketClient*>(Sender);
AnsiString msg = Client->ReceiveStr();
}
Regards,
Bevan
--
To unsubscribe or change your settings for TWSocket mailing list
please goto http://www.elists.org/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be