I believe the MS documentation already defined protocols specific for 
this kind of reconnection.

On 12/04/2010 08:54 AM, Mads Kiilerich wrote:
> Oleg fry Pelipenko wrote, On 12/02/2010 01:13 PM:
>> Hi,
>>
>> I have a problem when using freerdp with unstable network connection. Let me 
>> describe this problem. If freerdp connected to a server and this time breaks 
>> connection (for example, break the physical line between computers) between 
>> the client and server, the application window hangs. Further there are 
>> several possible outcomes of events:
>> 1) if the connection is restored rapidly, approximately less than 30-40 
>> seconds, the window comes alive and continues to operate normally;
>> 2) if the connection is restored later than 40 seconds after the break, the 
>> window and left hangling and in any way other than the completion of the 
>> window does not close.
>>
>> We find such work is not suitable for the client and, therefore, attempted 
>> to correct this problem. As we thought the best solution would be to define 
>> the command line parameter, which will indicate how many seconds after the 
>> connection is not restored should close the application window.
>> To implement this feature in the function tcp_send before going on to send 
>> data by calling a standard function I call the select function, to check 
>> whether it is possible to send data in writing sockets. And in this select 
>> we can set our timer.
>>
>> I want you to ask is this is the correct solution to the problem, maybe 
>> there are more appropriate way?
>
> I think I would try to use something like this to make sure we don't
> hang forever:
>
> --- a/X11/xfreerdp.c
> +++ b/X11/xfreerdp.c
> @@ -533,7 +533,8 @@
>                break;
>            }
>            /* do the wait */
> -        if (select(max_sck + 1,&rfds,&wfds, NULL, NULL) == -1)
> +        struct timeval tv = {10, 0};
> +        if (select(max_sck + 1,&rfds,&wfds, NULL,&tv) == -1)
>            {
>                /* these are not really errors */
>                if (!((errno == EAGAIN) ||
>
>
> If we haven't received anything for for example 30 seconds we could fail
> or reconnect.
>
> I don't remember how connections are kept alive with mstsc - or if we
> just can expect to receive keep-alive messages continuously. I guess I
> could dissect some mstsc sessions and figure it out.
>
> Anna Martynova wrote, On 12/03/2010 01:12 PM:
>> So, the question is: how to detect the moment when server becomes
>> unavailable? May be, we should use TCP keepalive? When server stops
>> response to keepalive probes, we will receive 'ETIMEDOUT' signal and
>> we can show some notice to user: "server is not available".
>> I think, keepalive is better then using 'select' on network socket,
>> because 'select' does not check the connection from client to server,
>> it only checks if the socket is ready to write.
>
> I can imagine that TCP keep-alive could be (too) hard to get working
> reliably on all platforms, but it can probably be done if you are
> persistent and know what you are doing.
>
> /Mads
>
> ------------------------------------------------------------------------------
> What happens now with your Lotus Notes apps - do you make another costly
> upgrade, or settle for being marooned without product support? Time to move
> off Lotus Notes and onto the cloud with Force.com, apps are easier to build,
> use, and manage than apps on traditional platforms. Sign up for the Lotus
> Notes Migration Kit to learn more. http://p.sf.net/sfu/salesforce-d2d
> _______________________________________________
> Freerdp-devel mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/freerdp-devel
>



------------------------------------------------------------------------------
What happens now with your Lotus Notes apps - do you make another costly 
upgrade, or settle for being marooned without product support? Time to move
off Lotus Notes and onto the cloud with Force.com, apps are easier to build,
use, and manage than apps on traditional platforms. Sign up for the Lotus 
Notes Migration Kit to learn more. http://p.sf.net/sfu/salesforce-d2d
_______________________________________________
Freerdp-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/freerdp-devel

Reply via email to