• BlackBerry Dynamics
  • Runtime library for iOS applications
  • 8.0.0.81
<GDSocketDelegate> Protocol Reference

Delegate for handling GDSocket state transitions and received data. More...

#import <GDNETiOS.h>

Description

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.

Instance Methods

(void) - onOpen:
 Socket opened callback. More...
 
(void) - onRead:
 Socket data received callback. More...
 
(void) - onClose:
 Socket closed callback. More...
 
(void) - onErr:inSocket:
 Socket error callback. More...
 

Method Documentation

◆ 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
socketGDSocket 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
socketGDSocket 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
socketGDSocket 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
errorGDSocketErrorType value for the socket error that occurred.
socketGDSocket object that issued the callback.

The documentation for this protocol was generated from the following file: