Examples of TFTPWriteRequestPacket


Examples of org.apache.commons.net.tftp.TFTPWriteRequestPacket

            log.debug("Received packet: " + packet.getAddress() + ':' + packet.getPort());
        final int type = packet.getType();
        switch (type) {
            case TFTPPacket.WRITE_REQUEST:
                if (clientAddress == null) {
                    TFTPWriteRequestPacket wreqPacket = (TFTPWriteRequestPacket) packet;
                    File file = new File(".", wreqPacket.getFilename());
                    log.info("Request to write file " + wreqPacket.getFilename() + " (" +
                            file.getAbsolutePath() + ") received from " + packet.getAddress() +
                        ':' + packet.getPort());
                    fileOut = new FileOutputStream(file);
                    blockNumber = 0;
                    bufferedSend(new TFTPAckPacket(packet.getAddress(), packet.getPort(), blockNumber));
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.