RTC Forums
May 02, 2024, 10:17:12 AM *
Welcome, Guest. Please login or register.

Login with username, password and session length
 
   Home   Help Login Register  
Pages: [1]
  Print  
Author Topic: on connect  (Read 3368 times)
Ronald van Tour
RTC License++
*****
Posts: 37


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


« Reply #1 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
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.023 seconds with 17 queries.