openTunnel method

void openTunnel([
  1. String sourceHost = '127.0.0.1',
  2. int sourcePort = 1234
])

Implementation

void openTunnel([String sourceHost = '127.0.0.1', int sourcePort = 1234]) {
  this.sourceHost = sourceHost;
  this.sourcePort = sourcePort;
  channel = client.openTcpChannel(
      sourceHost, sourcePort, tunnelToHost, tunnelToPort, (_, Uint8List m) {
    //client.debugPrint('DEBUG SSHTunneledSocketImpl.recv: ${String.fromCharCodes(m)}');
    //client.debugPrint('DEBUG SSHTunneledSocketImpl.recvRaw(${m.length}) = $m');
    onMessage(m);
  }, connected: () {
    if (connectHandler != null) connectHandler();
    connectHandler = null;
    connectError = null;
  }, error: (String description) {
    if (connectError != null) {
      connectError(description);
    } else {
      onError(description);
    }
    connectHandler = null;
    connectError = null;
  });
}