Delegate for handling GDSocket state transitions and received data.
More...
#import <BlackBerryDynamics/GD/GDNETiOS.h>
Errors and state changes that occur when using GDSocket are handled by creating a class that implements this protocol. The callback for handling received data is also part of this protocol.
◆ onOpen:
- (void) onOpen: |
|
(id) |
socket |
|
|
required |
This callback is invoked when the corresponding socket opens for communication with the remote server, see connect (GDSocket).
Invocation of this callback also notifies the application on the device that data can be written to the socket, using write (GDSocket).
- Parameters
-
socket | GD Socket object that issued the callback. |
◆ onRead:
- (void) onRead: |
|
(id) |
socket |
|
|
required |
This callback is invoked when data has been received from the remote server, and is ready to read. The function that is invoked should consume the received data.
The received data will be available in the corresponding socket's readStream buffer, which can be accessed using the GDDirectByteBuffer interface.
- Parameters
-
socket | GD Socket object that issued the callback. |
◆ onClose:
- (void) onClose: |
|
(id) |
socket |
|
|
required |
This callback is invoked when the corresponding socket is closed. This means closed by the remote end, or by the client end (see disconnect (GDSocket)).
Invocation of this callback notifies the application on the device that:
- The socket cannot now be used for writing.
- No more data will be received on the socket.
- Parameters
-
socket | GD Socket object that issued the callback. |
◆ onErr:inSocket:
- (void) onErr: |
|
(int) |
error |
inSocket: |
|
(id) |
socket |
|
|
| |
|
required |
This callback is invoked when a socket error occurs on the corresponding socket.
- Parameters
-
error | GDSocketErrorType value for the socket error that occurred. |
socket | GD Socket object that issued the callback. |
The documentation for this protocol was generated from the following file: