简体   繁体   English

在多个线程中使用jCIFS

[英]Using jCIFS in multiple threads

I am using jCIFS (SMB) to access network drives from a java desktop application. 我正在使用jCIFS(SMB)从Java桌面应用程序访问网络驱动器。 I notice that the first access takes around 6 seconds but, following that, there is very little delay. 我注意到第一次访问大约需要6秒钟,但之后几乎没有延迟。

However, when I connect to a network path on a new thread, the 6 second delay on first access is present again. 但是,当我连接到新线程上的网络路径时,第一次访问会再次出现6秒的延迟。

I assume that the delay is due to the initial authentication and that a session token (or something similar) is stored in the current thread. 我假设延迟是由于初始身份验证造成的,并且会话令牌(或类似内容)存储在当前线程中。

Is there a way to share the session between more than one thread? 有没有一种方法可以在多个线程之间共享会话?

I found this post JCIFS: file retrieval is too slow to be usable . 我在JCIFS上发现了这篇文章:文件检索太慢而无法使用

Using the setting, jcifs.Config.setProperty("jcifs.resolveOrder", "DNS"); 使用设置jcifs.Config.setProperty("jcifs.resolveOrder", "DNS"); , made the connect faster and resolved my problem. ,可以加快连接速度并解决了我的问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM