connect method

Future<StompClient> connect (StompConnector connector, { String host, String login, String passcode, List<int> heartbeat, void onConnect(StompClient client, Map<String, String> headers), void onDisconnect(StompClient client), void onError(StompClient client, String message, String detail, Map<String, String> headers), void onFault(StompClient client, dynamic error, dynamic stackTrace) })

Connects a STOMP server, and instantiates a StompClient

  • to represent the connection.
  • Notice: Instead of invoking this method,
  • you can invoke VM's connect if running on Dart VM
  • (non-browser).
  • Or, invoke WebSocket's connect if
  • running on a browser.

Implementation

static Future<StompClient> connect(StompConnector connector,
    {String host,
    String login,
    String passcode,
    List<int> heartbeat,
    void onConnect(StompClient client, Map<String, String> headers),
    void onDisconnect(StompClient client),
    void onError(StompClient client, String message, String detail,
        Map<String, String> headers),
    void onFault(StompClient client, error, stackTrace)}) {
  if (connector == null)
    throw new ArgumentError(
        "Required: connector. Use stomp_vm's connect() instead.");

  return _StompClient.connect(connector, host, login, passcode, heartbeat,
      onConnect, onDisconnect, onError, onFault);
}