[Gambas-user] Connect hang with latest revision

Caveat Gambas at ...1950...
Fri Jun 7 07:38:39 CEST 2013


Hmmm... well I've taken a quick glance at the source and the 
documentation (Shock news! Developer looks at documentation!!!) and it 
looks like it's less simple than we thought.

When making a connection, it seems as if Gambas insists on using 
Blocking mode True internally, there is no storage or remembering of the 
original Blocking mode, so as far as I can see any setting of Blocking 
mode prior to making a connect is not going to be useful anyway.  In 
fact, from reading the documentation of Gambas 
(http://gambasdoc.org/help/comp/gb.net/socket?v3), it looks like it's 
expected that all Socket comms will be be in non-Blocking (asynchronous) 
mode:

"This class performs its work asynchronously, so the program will not be 
stopped while connecting, sending or receiving data. "

Also it looks like the code relating to Blocking/non-Blocking is 
provided by the Stream class which Socket inherits.  I think if we're 
going to make it possible for the user to specify whether they want 
Blocking or not, and by implication, set a Timeout value... it will need 
a little more work than just a tweak to call set_timeout whenever 
set_blocking is called...

Kind regards,
Caveat

On 03/06/13 21:14, Benoît Minisini wrote:
> Le 02/06/2013 17:05, Ron a écrit :
>> Bug #1 and Bug #2 are fixed, thanks for that!
>>
>> The time it takes for Event_Error to trigger is still more than 2 minutes.
>> I see that in ClientSocket there is a 10sec timer running which cuts
>> the socket if still not connected.
>>
>> Is this the way it should be implemented, what about the TimeOut
>> property it seems it doesn't work?
>> Would be nice if users know after 10 secs that the socket is unable to
>> connect, +2 minutes is too long...
>>
>> Regards,
>> Ron.
>>
> Hi Ron,
>
> I have implemented what Caveat told in revision #5696: the timeout is
> reset each time the blocking mode changes internally.
>
> Can you try it and tell me if it changes anything for you?
>





More information about the User mailing list