ConnectionCallback

public class ConnectionCallback

A callback in the library to be notified by the connection owner for specific events.

Methods

bytesRead

public void bytesRead(int statusCode, byte[] bytes)

Sends the bytes read to the callback. The status code should be set to some value besides StatusCode.SUCCESS if an error happened, and it’s best if the code can be one of the constants from StatusCode.

bytesWritten

public void bytesWritten(int statusCode, long byteCount)

Notifies the callback that bytes have been written to the connection.

statusChanged

public void statusChanged(int connectionId, ConnectionStatus newStatus)

Called when the status of the connection changes.