I end up switching HTTP connectors to solve my problem. In my scenario I have client application running on Fedora using restlet using the Apache HTTP connector that talks to a restlet server running on Ubuntu using the Grizzly HTTP connector. The conditions you are describing are match what I was experiencing.
Switching to the Apache HTTP connector on the client side solved my problem. I think I have since fixed a bug in my code where I wasn't completely consuming the input stream in all cases. But, I doubt that was my original problem. -- Timothy On Fri, Sep 10, 2010 at 3:28 AM, Achim W. <[email protected]> wrote: > Hi! > > Using Restlet 1.1.10, Sun Java 6, tested on Windows XP/Debian/Ubuntu. > > I found a problem in NET client connector. Sometimes there is a Exception > with messages: > - java.io.IOException: Broken pipe (Server) > - java.net.SocketException: Unexpected end of file from server (Client) > > When using the standard(?)/fall-back(?) Connector (i.e > "com.noelios.restlet.http.StreamClientHelper", NET .jar _not_ in the > classpath) there is no problem. > > When using the NET Connector (i.e. > "com.noelios.restlet.ext.net.HttpClientHelper", NET .jar in the classpath) > then every second request fails if there is a specific time (~2 - ~5 > seconds) between the current and the previous request. It seems the server > closes the connection after ~2(?) seconds after the last request/response > which answers the client with FIN. But the client does not really close the > connection within ~5 seconds. If the next request is within those 5 seconds > the client tries to reuse the old (already closed by server) connection. > > This problem exist in NET connector when using HTTP and when using HTTPS. > Standard connector has no problem when using HTTP, HTTPS is not supported by > standard connector. > > I found another post of a user with the same problem but he couldn't > reproduce it (outside of his production environment): > > http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2363539 > > I have written sample programs for server/client which show the issue. When > using 0msec and 5200msec between request there is no problem, when using > 2000msec the exception occurs every second request. > > Attached are the sample programs as eclipse projects and traces of > HTTP+standard connector, HTTP+NET connector and HTTPS+NET connector. > To use the NET connector just remove the NET lib from the build path of the > client project. > > best regards > Achim > > ------------------------------------------------------ > > http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2657466 ------------------------------------------------------ http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2659656

