现在我需要用tftp 讲一个文件传到服务器的/temp目录下 但是TftpClient 没有方法来设置这个上传目录的?而且我在调用sendFile()的时候 一直报超时链接?TFTPClient tftp = new TFTPClient();
tftp.setDefaultTimeout(60000);try {
tftp.open();
File file = new File("E://aa.tar.gz");
InputStream in = new FileInputStream(file);
int transferMode = TFTP.BINARY_MODE;
tftp.sendFile("dds.tar.gz", transferMode, in, "192.168.58.110");
} catch (SocketException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (Exception e) {
e.printStackTrace();
}
tftp.setDefaultTimeout(60000);try {
tftp.open();
File file = new File("E://aa.tar.gz");
InputStream in = new FileInputStream(file);
int transferMode = TFTP.BINARY_MODE;
tftp.sendFile("dds.tar.gz", transferMode, in, "192.168.58.110");
} catch (SocketException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (Exception e) {
e.printStackTrace();
}
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货