openTunnel method
Sends MSG_CHANNEL_OPEN_TCPIP for tunnelToHost:tunnelToPort.
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;
});
}