question: public static Socket doInteraction ( final HttpsURLConnection clientConnection , final ServerSocket serverSocket , final int responseCode , final boolean doAuthentication ) throws Throwable { clientConnection . setDoInput ( true ) ; clientConnection . setConnectTimeout ( TIMEOUT ) ; clientConnection . setReadTimeout ( TIMEOUT ) ; ServerWork server = new ServerWork ( serverSocket , responseCode , doAuthentication ) ; ClientConnectionWork client = new ClientConnectionWork ( clientConnection ) ; ExecutorService executorService = Executors . newFixedThreadPool ( 2 ) ; try { Future < Void > serverFuture = executorService . submit ( server ) ; Future < Void > clientFuture = executorService . submit ( client ) ; Throwable t = null ; try { serverFuture . get ( 30 , TimeUnit . SECONDS ) ; } catch ( ExecutionException e ) { t = e . getCause ( ) ; } try { clientFuture . get ( 30 , TimeUnit . SECONDS ) ; } catch ( ExecutionException e ) { if ( t != null ) { t . printStackTrace ( ) ; } t = e . getCause ( ) ; } if ( t != null ) { throw t ; } } catch ( ExecutionException e ) { throw e . getCause ( ) ; } finally { executorService . shutdown ( ) ; } return server . peerSocket ; }
target:  Performs interaction between client's HttpsURLConnection and servers side (ServerSocket). Server will response with specified response code.