RTC Forums

Subscription => Support => Topic started by: Ronald van Tour on September 27, 2010, 08:59:59 AM



Title: on connect
Post by: Ronald van Tour on September 27, 2010, 08:59:59 AM
I use the Onconnect, Onconnectfail and Onconnectlost events to determine wheter there is a RTCconnection or not.
This works fine.

When UseProxy is set to True, something goes wrong.

The RTCHttpClient says its connected even when the server program is turned off.
Or even when there is no LAN connection at all.


Is there someway to fix this problem?


Title: Re: on connect
Post by: D.Tkalcec (RTC) on September 27, 2010, 09:24:08 AM
There is nothing wrong. That is simply how WinInet and WinHTTP APIs work. When you connect using the WinInet or WinHTTP API, you have no direct control over physical connections. The WinInet and WinHTTP APIs decide for themselves when a connection is required and open/close connections as they see fit. A connection is usually opened when a request has to be sent and closed after a response is received. If you are using the WinInet or WinHTTP API (useProxy=True or UseWinHTTP=True), you will get the OnConnect after the RTC SDK opens a connection to the API and OnDisconnect events when the API says a connection was closed by force.

When using the HTTP protocol you should generally NOT rely on information about physical connection status when there is no data being sent nor received. The only time the information about a connection status should matter is when data has to be sent or received (sending a request and receiving a response on the client side, receiving a request and sending a response on the server side).

Best Regards,
Danijel Tkalcec