my ftp code
<cfscript>
FTPserver="163.00.00.100";
FTPPort=2201;
FTPusername="user"
FTPpassword="pwd";
cfftp (action="open" username="#FTPusername#" password="#FTPpassword#" server="#FTPserver#" port="#FTPPort#" connection="My_query" secure=true);
cfftp (action="listDir" connection="My_query" name="test" directory="/");//take 10 sec
dump(test)
cfftp (action="close" connection="My_query");
</cfscript>
I tried to get the jstack, but it’s slow on getHostName
, even though I’m using an IP address.
Call stack:
java.base@11.0.7/java.net.Inet6AddressImpl.getHostByAddr(Native Method)
java.base@11.0.7/java.net.InetAddress$PlatformNameService.getHostByAddr(InetAddress.java:935)
java.base@11.0.7/java.net.InetAddress.getHostFromNameService(InetAddress.java:659)
java.base@11.0.7/java.net.InetAddress.getHostName(InetAddress.java:602)
java.base@11.0.7/java.net.InetAddress.getHostName(InetAddress.java:574)
lucee.runtime.tag.Ftp.actionListDir(Ftp.java:569)
lucee.runtime.tag.Ftp.doEndTag(Ftp.java:182)
createcada.sftp_cfm$cf$n.call(/schedule/createCADA/sftp.cfm:10)
If I add the domain name to the hosts file, listDir
only takes 0.1 seconds.
C:\Windows\System32\drivers\etc\hosts
Don’t forget to tell us about your stack!
OS: windows 11
Java Version: 11.0.7 (AdoptOpenJDK) 64bit
Tomcat Version: Apache Tomcat/9.0.35
Lucee Version: Lucee 5.3.10.120