public synchronized void passiveConnect ( DataSource source , TransferContext context , ServerSocket serverSocket ) throws ServerException { // things would get messed up if more than 1 file was transfered // simultaneously with the same transfer manager if ( transferThreadCount != 0 ) { throw new ServerException ( ServerException . PREVIOUS_TRANSFER_ACTIVE ) ; } Task task = new GridFTPPassiveConnectTask ( serverSocket , source , localControlChannel , gSession , dataChannelFactory , ( EBlockParallelTransferContext ) context ) ; runTask ( task ) ; }
Accept connection from the remote server and start transfer thread that will read incoming data and store in the sink . This method because of direction of transfer cannot be used with EBlock . Therefore it is fixed to create only 1 connection .