# ConnectionDelegate

    @objc public protocol ConnectionDelegate: class

The Connection delegate protocol defines the event methods available for channel Connection/DisConnection.

### Optional Callbacks for Connection

- `onConnect(_:)`

  event occur when connection occur with channel.

  #### Declaration

  Swift

      @objc optional func onConnect(_ error: NSError?)

  #### Parameters

  `error` | connection error

- `onDisconnect(_:)`

  event occur when Disconnection occur with channel.

  #### Declaration

  Swift

      @objc optional func onDisconnect(_ error: NSError?)

  #### Parameters

  `error` | disconnect error.

- `onClientConnect(_:)`

  event occur when other client connects with channel.

  #### Declaration

  Swift

      @objc optional func onClientConnect(_ client: ChannelClient)

  #### Parameters

  `client` | client info.

- `onClientDisconnect(_:)`

  event occur when other client disconnects with channel.

  #### Declaration

  Swift

      @objc optional func onClientDisconnect(_ client: ChannelClient)

  #### Parameters

  `client` | client info.

- `onError(_:)`

  event occur when a Channel Error is fired

  #### Declaration

  Swift

      @objc optional func onError(_ error: NSError)

  #### Parameters

  `error` | error.

- `onReady()`

  event occur when the host app is ready to send or receive messages

  #### Declaration

  Swift

      @objc optional func onReady()

© 2017 . All rights reserved. (Last updated: 2017-06-08)

Generated by jazzy ♪♫ v0.7.4, a Realm project.