title: JCIFS jcifs.smb.SmbException: A device attached to the system is not functioning
body: <p>We are using JCIFS (1.3.17) to load image files from a Windows 2003 file server. Unfortunatly loading  stops working after 16384 files and we get an the following exception when trying to access more files:</p>
  
  <pre><code>jcifs.smb.SmbException: A device attached to the system is not functioning.
      at jcifs.smb.SmbTransport.checkStatus(SmbTransport.java:563) ~[jcifs-1.3.17.jar:na]
      at jcifs.smb.SmbTransport.send(SmbTransport.java:663) ~[jcifs-1.3.17.jar:na]
      at jcifs.smb.SmbSession.send(SmbSession.java:238) ~[jcifs-1.3.17.jar:na]
      at jcifs.smb.SmbTree.send(SmbTree.java:119) ~[jcifs-1.3.17.jar:na]
      at jcifs.smb.SmbFile.send(SmbFile.java:775) ~[jcifs-1.3.17.jar:na]
      at jcifs.smb.SmbFile.open0(SmbFile.java:989) ~[jcifs-1.3.17.jar:na]
      at jcifs.smb.SmbFile.open(SmbFile.java:1006) ~[jcifs-1.3.17.jar:na]
      at jcifs.smb.SmbFileInputStream.&lt;init&gt;(SmbFileInputStream.java:73) ~[jcifs-1.3.17.jar:na]
      at jcifs.smb.SmbFileInputStream.&lt;init&gt;(SmbFileInputStream.java:65) ~[jcifs-1.3.17.jar:na]
      at jcifs.smb.SmbFile.getInputStream(SmbFile.java:2844) ~[jcifs-1.3.17.jar:na]
  </code></pre>
  
  <p>It seems that there is some kind of limitation or setting in  JCIFS that causes this problem.</p>
  
  <p>Here is some test code reproduce the problem:</p>
  
  <pre><code>    for (int i = 0; i &lt; 20000; i++) {
          try {
              SmbFile smbFile = new SmbFile("smb://fileserver/share/image.jpg", auth);
              byte[] data = IOUtils.toByteArray(smbFile.getInputStream());
              System.out.println(smbFile.getPath() + "  " + data.length);
          } catch (SmbException e) {
              e.printStackTrace();
          } catch (MalformedURLException e) {
              e.printStackTrace();
          } catch (IOException e) {
              e.printStackTrace();
          }
  
      }
  </code></pre>
  
  <p>We've checked the error logs on the file server but there is nothing to see so we assume that we are doing something wrong or there is something in JCIFS we have to configure properly.</p>