public void shutdown() { if (trc.isFineEnabled()) trc.fine("Transfer ended for thread: " + Thread.currentThread().getName()); shutdownTransfer = true; try { transferTftp_.close(); } catch (RuntimeException e) { // noop } resume(); }
public void shutdown() { if (trc.isFineEnabled()) trc.fine("Transfer ended for thread: " + Thread.currentThread().getName()); shutdownTransfer = true; try { transferTftp_.close(); } catch (RuntimeException e) { // noop } resume(); }
/** * Stop the tftp server (and any currently running transfers) and release all * opened network resources. */ public void shutdown() { shutdownServer = true; for (TransferActivityImpl xfer : activities.values()) xfer.getSource().shutdown(); try { serverTftp_.close(); } catch (RuntimeException e) { // noop } try { serverThread.join(); } catch (InterruptedException e) { // we've done the best we could, return } } }
/** * Stop the tftp server (and any currently running transfers) and release all * opened network resources. */ public void shutdown() { shutdownServer = true; for (TransferActivityImpl xfer : activities.values()) xfer.getSource().shutdown(); try { serverTftp_.close(); } catch (RuntimeException e) { // noop } try { serverThread.join(); } catch (InterruptedException e) { // we've done the best we could, return } } }
/** * The actual tftp server-thread. * Fork a transfer-thread for each request received. */ public void run() { try { while (!shutdownServer) { TFTPPacket tftpPacket; tftpPacket = serverTftp_.receive(); TFTPTransfer tt = createTransferActivity(tftpPacket); Thread thread = new Thread(tt); thread.setDaemon(true); thread.start(); } } catch (Exception e) { if (!shutdownServer) { trc.severe("Unexpected Error in TFTP Server - Server shut down! + " + e); } } finally { shutdownServer = true; // set this to true, so the launching thread can check to see if it started. if (serverTftp_ != null && serverTftp_.isOpen()) { serverTftp_.close(); } } }
/** * The actual tftp server-thread. * Fork a transfer-thread for each request received. */ public void run() { try { while (!shutdownServer) { TFTPPacket tftpPacket; tftpPacket = serverTftp_.receive(); TFTPTransfer tt = createTransferActivity(tftpPacket); Thread thread = new Thread(tt); thread.setDaemon(true); thread.start(); } } catch (Exception e) { if (!shutdownServer) { trc.severe("Unexpected Error in TFTP Server - Server shut down! + " + e); } } finally { shutdownServer = true; // set this to true, so the launching thread can check to see if it started. if (serverTftp_ != null && serverTftp_.isOpen()) { serverTftp_.close(); } } }
if (transferTftp_ != null && transferTftp_.isOpen()) { transferTftp_.endBufferedOps(); transferTftp_.close();
if (transferTftp_ != null && transferTftp_.isOpen()) { transferTftp_.endBufferedOps(); transferTftp_.close();