blackberry.com
BlackBerry Dynamics
Runtime library for iOS applications
from the application developer portal
Public Member Functions

<GDSocketDelegate> Protocol Reference

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

#import <GDNETiOS.h>

List of all members.

Public Member Functions


Detailed 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.


Member Function Documentation

- (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.
- (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.
- (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.
- (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: