title: Jetty server is dropping request originated from same port from client machine. Client times out
body: <p>I am using Jetty7 as a REST server. By handling REST requests i support webdav connections from Win7 clients. My problem is like this: </p>
  
  <ul>
  <li><p>(1) If i double click a file, Client sends a GET request for a file. When captured in wireshark, it shows that the request originated from client's port 54456 to server port 80 where jetty is running. </p></li>
  <li><p>(2) The request comes to my REST handler for GET and then i build the response like this:</p></li>
  </ul>
  
  <blockquote>
    <p>ResponseBuilder builder = javax.ws.rs.core.Response.ok(); <br/>
         builder.header("Keep-Alive", "timeout=15, max=99"); <br/>
         builder.header("Connection", "Keep-Alive"); <br/>
         builder.header("Cache-Control", "no-store"); <br/>
         builder.header("Accept-Ranges", "bytes"); <br/>
         builder.header("Last-Modified", new Rfc1123DateFormat().format(new Date(lastModified))); <br/>
         builder.header("Content-Length", fileLength); <br/>
         InputStream in = new BufferedInputStream(in); //'in' was InputStream which i got from other module and has the file
    content.<br/>
         return builder.entity(in).build();<br/></p>
  </blockquote>
  
  <p>Here, 'in' is the BufferedInputStream which contains the file which was asked. </p>
  
  <ul>
  <li><p>(3) File opens on client machine. But in my packet trace, the response header does not contain the entry: Connection: Keep-Alive...Strange!!! </p></li>
  <li><p>(4)Then i double clicked a folder from client. This sent a PROPFIND request to server. The request originated again from client's port 54456. I  also put a packet capturing on server. The trace on server confirmed that a PROPFIND request reached server from port no 54456.....but my handler never got called. Ultimately, client keeps waiting and times-out. After that either client tries again or shows an error that path was not found. </p></li>
  <li><p>(5) But if the PROPFIND request originates from any other port (on which previous GET request originated), then jetty server handles it and my handler gets called... </p></li>
  <li><p>(6) One more observation: If call sequence from client is like this: first client sends a PROPFIND from client's port say 54400 and server responds. Then again PROPFIND from same port, then jetty handles that too.. But only a GET followed by some other request is causing jetty not to respond. </p></li>
  </ul>
  
  <p>I tried increasing/decreasing maxIdleTimeOut inside Jetty.xml file but nothing helps. 
  I want to know that is it possible to make jetty handle these requests...Either through some code change in my area or some config change. OR if you can see some wrong coding done by me... </p>
  
  <p>thanks, 
  Anil.</p>