Lightstreamer iOS Client 1.2.6
Native iOS Client library for Lightstreamer
|
The LSConnectionDelegate protocol receives notifications of connection activity and errors. More...
#import <LSConnectionDelegate.h>
Public Member Functions | |
(void) | - clientConnection:didStartSessionWithPolling: |
Notification that the session has been successfully opened. | |
(void) | - clientConnection:didReceiveNewBytes: |
Notification that the connection received new bytes from the Server. | |
(void) | - clientConnection:didChangeActivityWarningStatus: |
Notification that the connection did enter or did exit a stalled state. | |
(void) | - clientConnectionDidEstablish: |
Notification that the connection has been established. | |
(void) | - clientConnectionDidClose: |
Notification that the connection did close. | |
(void) | - clientConnection:didEndWithCause: |
Notification that the connection did end due to a Server-side decision. | |
(void) | - clientConnection:didReceiveDataError: |
Notification that a block of data received from the Server could not be correctly interpreted. | |
(void) | - clientConnection:didReceiveServerFailure: |
Notification that an unrecoverable exception signaled by the Server has been received. | |
(void) | - clientConnection:didReceiveConnectionFailure: |
Notification that an unrecoverable connection error has been detected. | |
(void) | - clientConnection:willSendRequestForAuthenticationChallenge: |
Notification that the LSClient's underlying connection is going to request authentication for a challenge in order to proceed. | |
(void) | - clientConnection:isAboutToSendURLRequest: |
Notification that the LSClient is going to submit an URL request. |
The LSConnectionDelegate protocol receives notifications of connection activity and errors.
Note: almost all notifications are sent in sequence on a dedicated thread. Only notifications regarding client authentication and request decoration are called directly from the session thread. See clientConnection:willSendRequestForAuthenticationChallenge:
and clientConnection:isAboutToSendURLRequest:
for more information.
- (void) clientConnection: | (LSClient *) | client | |
didChangeActivityWarningStatus: | (BOOL) | warningStatus | |
[optional] |
Notification that the connection did enter or did exit a stalled state.
"Stalled" means that the LSClient object did not receive any new bytes for more then the probeWarningSecs specified on the LSConnectionInfo object when opening the connection. It may be a simptom of an impending connection drop.
client | The LSClient object that handles the connection. |
warningStatus | YES if the connection did enter a stalled state, NO otherwise. |
- (void) clientConnection: | (LSClient *) | client | |
didEndWithCause: | (int) | cause | |
[optional] |
Notification that the connection did end due to a Server-side decision.
When this notification is received the LSClient will stop trying to reconnect automatically.
client | The LSClient object that handles the connection. |
cause | Specifies the cause that led the Server to close the connection. |
- (void) clientConnection: | (LSClient *) | client | |
didReceiveConnectionFailure: | (LSPushConnectionException *) | failure | |
[optional] |
- (void) clientConnection: | (LSClient *) | client | |
didReceiveDataError: | (LSPushUpdateException *) | error | |
[optional] |
Notification that a block of data received from the Server could not be correctly interpreted.
client | The LSClient object that handles the connection. |
error | The specific exception that explains the error. |
- (void) clientConnection: | (LSClient *) | client | |
didReceiveNewBytes: | (int) | bytesLength | |
[optional] |
Notification that the connection received new bytes from the Server.
client | The LSClient object that handles the connection. |
bytesLength | The number of bytes received |
- (void) clientConnection: | (LSClient *) | client | |
didReceiveServerFailure: | (LSPushServerException *) | failure | |
[optional] |
- (void) clientConnection: | (LSClient *) | client | |
didStartSessionWithPolling: | (BOOL) | polling | |
[optional] |
Notification that the session has been successfully opened.
This notification is received just once per session, i.e. in a polled connection will be received only once. Anyway, it may be received more than once if the LSClient has to reconnect due to external reasons (e.g. connection drops).
client | The LSClient object that handles the connection. |
polling | Tells if the session is in streaming mode or polling mode. |
- (void) clientConnection: | (LSClient *) | client | |
isAboutToSendURLRequest: | (NSMutableURLRequest *) | urlRequest | |
[optional] |
Notification that the LSClient is going to submit an URL request.
It gives a chance to decorate the request before it is sent to the server, e.g. to set a specific header field or cookie policy.
Note: this notification is called directly from the session thread. The method implementation should be fast and nonblocking. Any slow operations should have been performed in advance.
Warning: implement this notification only if you know what you are doing. Arbitrary changes to the URL request content may lead to connection malfunctioning.
client | The LSClient object that handles the connection. |
urlRequest | The URL request being sent. |
- (void) clientConnection: | (LSClient *) | client | |
willSendRequestForAuthenticationChallenge: | (NSURLAuthenticationChallenge *) | challenge | |
[optional] |
Notification that the LSClient's underlying connection is going to request authentication for a challenge in order to proceed.
If the delegate implements this method, the connection will suspend until [challenge sender]
is called with one of the following methods:
useCredential:forAuthenticationChallenge:
, continueWithoutCredentialForAuthenticationChallenge:
, cancelAuthenticationChallenge:
, performDefaultHandlingForAuthenticationChallenge:
or rejectProtectionSpaceAndContinueWithChallenge:
.
If not implemented, the default behavior will call performDefaultHandlingForAuthenticationChallenge:
on the [challenge sender]
.
Note: this notification is called directly from the session thread. The method implementation should be fast and nonblocking. Any slow operations should have been performed in advance.
client | The LSClient object that handles the connection. |
challenge | The challenge that the client must authenticate in order to proceed with its request. |
- (void) clientConnectionDidClose: | (LSClient *) | client | [optional] |
- (void) clientConnectionDidEstablish: | (LSClient *) | client | [optional] |
Notification that the connection has been established.
This notification is received each time the LSClient reconnects automatically, even if on the same session. I.e., in a polled connection will be received at each poll cycle. It may also be received more than once also if the LSClient has to reconnect due to external reasons (e.g. connection drops).
client | The LSClient object that handles the connection. |