while(true) {
final Socket s = socket.accept();
new Thread("Port forwarding session from "+s.getRemoteSocketAddress()) {
public void run() {
try {
final OutputStream out = forwarder.connect(new RemoteOutputStream(new SocketOutputStream(s)));
new CopyThread("Copier for "+s.getRemoteSocketAddress(),
new SocketInputStream(s), out).start();
} catch (IOException e) {
// this happens if the socket connection is terminated abruptly.
LOGGER.log(FINE,"Port forwarding session was shut down abnormally",e);