connect static method

Future<WipConnection> connect(
  1. String url, {
  2. Function? onError,
})

Connect to the given url and return a WipConnection.

On errors from this stream, the onError handler is called with the error object and possibly a stack trace. The onError callback must be of type void Function(Object error) or void Function(Object error, StackTrace).

Implementation

static Future<WipConnection> connect(String url, {Function? onError}) {
  return WebSocket.connect(url).then((socket) {
    return WipConnection._(url, socket, onError: onError);
  });
}