RTC Forums

Subscription => Support => Topic started by: rloewy on June 16, 2010, 10:43:08 PM



Title: Correct settings for OnConnectFail/OnConnectError
Post by: rloewy on June 16, 2010, 10:43:08 PM
I am using a TRTCHttpClient where I implemented a OnConnectError and OnConnectFail events - which are never called.

Basically, if I disconnect the machine from the network before the trying to connect - the application never seems to get the error handlers called.

I have set ReconnectOn.ConnectError and ConnectFail to false, All timeout properties are set to 0, UseWinHTTP to false, MultiThreaded to true

Any idea what I am doing wrong?

Ron.


Title: Re: Correct settings for OnConnectFail/OnConnectError
Post by: D.Tkalcec (RTC) on June 16, 2010, 10:47:42 PM
What is your "useProxy" property setting?


Title: Re: Correct settings for OnConnectFail/OnConnectError
Post by: rloewy on June 16, 2010, 10:55:50 PM
What is your "useProxy" property setting?

It is set to True. Is that the cause of the issue?

Ron.


Title: Re: Correct settings for OnConnectFail/OnConnectError
Post by: D.Tkalcec (RTC) on June 16, 2010, 11:01:32 PM
Yes. When you set "useProxy" to TRUE, WinInet API connection provider will be used which does not have the concept of physical connections, so that calling "Connect" will only prepare a connection while the actual task of "connecting" will be done transparently by WinInet at discrete times. When using the WinInet API, you will only get request-related events and the OnConnectLost event, which tells you that the request could not be successfully sent.

Best Regards,
Danijel Tkalcec


Title: Re: Correct settings for OnConnectFail/OnConnectError
Post by: rloewy on June 16, 2010, 11:02:42 PM
Thanks,

I will give it a try.

All the best,
 Ron.


Title: Re: Correct settings for OnConnectFail/OnConnectError
Post by: D.Tkalcec (RTC) on June 16, 2010, 11:16:51 PM
Another important thing to know when using the WinInet API (when useProxy=TRUE and useWinHTTP=FALSE) is that the WinInet API will never open more than 2 physical connections to the same Server, regardless of how many TRtcHttpClient components you use. This has nothing to do with the RTC SDK, it is simply how the WinInet API works.

If your Clients do not have to work through a Proxy, leave the "useProxy" property FALSE to use the WinSock API which does not have that limitation and will trigger the OnConnectError or OnConnectFail event after you call Connect if the Server you are trying to connect to is inaccessible.

Best Regards,
Danijel Tkaclec