public TelnetTerminal createTelnetTerminal ( ) { try { System . err . print ( "Waiting for incoming telnet connection on port " + telnetPort + " ... " ) ; System . err . flush ( ) ; TelnetTerminalServer tts = new TelnetTerminalServer ( telnetPort ) ; TelnetTerminal rawTerminal = tts . acceptConnection ( ) ; tts . close ( ) ; // Just for single-shot: free up the port! System . err . println ( "Ok, got it!" ) ; if ( mouseCaptureMode != null ) { rawTerminal . setMouseCaptureMode ( mouseCaptureMode ) ; } if ( inputTimeout >= 0 ) { rawTerminal . getInputDecoder ( ) . setTimeoutUnits ( inputTimeout ) ; } return rawTerminal ; } catch ( IOException ioe ) { throw new RuntimeException ( ioe ) ; } }
Creates a new TelnetTerminal