> resulting in an empty string, despite the fact that by inspecting the
> object I could see there is data in the receive buffer.

There is no receive buffer in the component !

> I'm getting error 10035  (operation would block) and
> wondered why this would happen now and not
> previously.

Error 10035 is not really an error when using non blocking socket. It just 
means nothing is ready to be read.
Instead of ReceiveStr, I suggest you use Receive where you have better 
control and is faster since it doesn't involve the memory allocation needed 
for strings.

> Does anyone have any suggestions about what might be going wrong here?

The most common source of probelm is calling the message pump 
(ProcessMessages and the like) directly or indirectly (For example with a 
modal form or a simple ShowMessage).

--
Contribute to the SSL Effort. Visit http://www.overbyte.be/eng/ssl.html
--
[EMAIL PROTECTED]
http://www.overbyte.be



----- Original Message ----- 
From: "Bevan Edwards" <[EMAIL PROTECTED]>
To: "ICS support mailing" <twsocket@elists.org>
Sent: Thursday, January 11, 2007 7:28 PM
Subject: [twsocket] WinSock error 10035 with TWSocketServer


> Hi all,
>
> I am using BDS2006 to write a service application that creates a
> TWSocketServer and waits for connections.  When a connection is made,
> the client sends requests and the service processes the requests and
> returns the results.
>
> This is all being done with LineMode enabled.
>
> I've written a similar module in another application recently and that
> went without a hitch.
>
> In this particular case (using code copied from the other application),
> in OnDataAvailable for the TWSocketClient I type cast the Sender to a
> TWSocketClient and then call ReceiveStr to retrieve the data.  This was
> resulting in an empty string, despite the fact that by inspecting the
> object I could see there is data in the receive buffer.  Further
> investigation/testing has revealed that I'm getting error 10035
> (operation would block) and wondered why this would happen now and not
> previously.
>
> The only thing I can think of that I'm doing different is that the
> testing is being done on one machine, whereas I don't think I did that
> previously.  However, I have tested this application with the client on
> another machine and it exhibits the same problem.
>
> Another thing I noticed is that if I do:
>      AnsiString msg = ((TWSocketClient*)Sender)->ReceiveStr();
> at the start of the OnDataAvailable event, then I get the data coming
> through.  But I believe (based on the existing application that works)
> that I should be able to typecast the Sender variable first.
>
> Does anyone have any suggestions about what might be going wrong here?
>
> Regards,
>
> Bevan Edwards
>
> -- 
> 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 

-- 
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

Reply via email to