D.Tkalcec (RTC)
|
|
« Reply #1 on: August 14, 2013, 05:50:48 PM » |
|
OnConnectLost and OnConnectFail are WinSock-only events, which won't fire if you are using any other API.
When using general HTTP requests (not remote functions), you can use the OnRepostCheck or OnResponseAbort events, which are available on the TRtcDataRequest component and will notify you when a request (after it was posted to the request queue) has been aborted - for whatever reason.
When working with remote functions, you can either use OnRepostCheck/OnResponseAbort events on the TRtcClientModule component, or ... you can use the RequestAborted event on the TRtcResult component.
Altrernatively, you can use the OnRepostCheck and/or OnResponseAbort events on the TRtcHttpClient component, in case you want to implement general connection error handling, indepenent of the request which was aborted.
NOTE: WinInet and WinHTTP APIs do not have a concept of a physical connection, but instead follow a concept of requests and responses. These APIs are used when useProxy=TRUE, useSSL=True or useWinHTTP=True. When using these APIs, the Connect/Disconnect events will trigger when the components are linked to the API, and NOT when a phisical connection is open or closed to the Server. This is why you should NOT rely on connection events, but instead use OnRepostCheck, OnResponseAbort and RequestAborted events to handle all kinds of connection problems on the Client side.
Best Regards, Danijel Tkalcec
|