RTC Forums
November 25, 2024, 02:58:42 AM *
Welcome, Guest. Please login or register.

Login with username, password and session length
 
   Home   Help Login Register  
Pages: [1]
  Print  
Author Topic: Correct settings for OnConnectFail/OnConnectError  (Read 5725 times)
rloewy
Newbie
*
Posts: 3


« 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.
Logged
D.Tkalcec (RTC)
Administrator
*****
Posts: 1881


« Reply #1 on: June 16, 2010, 10:47:42 PM »

What is your "useProxy" property setting?
Logged
rloewy
Newbie
*
Posts: 3


« Reply #2 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.
Logged
D.Tkalcec (RTC)
Administrator
*****
Posts: 1881


« Reply #3 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
Logged
rloewy
Newbie
*
Posts: 3


« Reply #4 on: June 16, 2010, 11:02:42 PM »

Thanks,

I will give it a try.

All the best,
 Ron.
Logged
D.Tkalcec (RTC)
Administrator
*****
Posts: 1881


« Reply #5 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
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.21 | SMF © 2015, Simple Machines Valid XHTML 1.0! Valid CSS!
Page created in 0.025 seconds with 17 queries.