[Gambas-user] Connect hang with latest revision

Ron ron at ...1740...
Fri Jun 7 08:49:55 CEST 2013


Thanks.
The blocking mode issue is not that bad, since I always want to use 
non-blocking mode anyway, my project is too big to be interupted by sockets.

About the timeout I thought gambas2 did this correctly, but I'm not sure 
now, since the ClientSocket example uses a timer to remove Socket if it 
isn't connected in 10 seconds.

Regards,
Ron_2nd.
> 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?
>>
>
> ------------------------------------------------------------------------------
> How ServiceNow helps IT people transform IT departments:
> 1. A cloud service to automate IT design, transition and operations
> 2. Dashboards that offer high-level views of enterprise services
> 3. A single system of record for all IT processes
> http://p.sf.net/sfu/servicenow-d2d-j
> _______________________________________________
> Gambas-user mailing list
> Gambas-user at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/gambas-user





More information about the User mailing list