Sockets, writing data and shutdownOutput



My client connects to an HTTP server by opening a
socket, starting a separate thread to feed it with
data and reading the response in the main
thread. The feeder thread basically does this:

OutputStream out = socket.getOutputStream();
out.write(...);
out.flush();
socket.shutdownOutput();

Problem: roughly half of the time the server
resets the connection before sending its response?

I use the shutdownOutput to make sure the server
understands that we are done and no more data can
be expected, but it seems that it overinterpretes
it as if my client is not interested in
pending response data?

Anyone had this problem and can shed some more
light on it?

Harald.
------------------------------------------------------------------------
Java Text Crunching: http://www.ebi.ac.uk/Rebholz-srv/whatizit/software

.



Relevant Pages

  • Re: ssh through vista connection sharing not working, NEW INFO: 802.1q headers from vista
    ... The ssh client is a linux laptop. ... connection with wireshark, and I see the response from the ssh server, ... Connection sharing is turned on in the Vista. ...
    (comp.os.linux.networking)
  • Re: How can I detect a carriage return using java.net
    ... With all due respect, I think that the connection should always be opened and closed by the client: if the server closes the connection you have no way of telling if the network broke, the server crashed or if it was an intentional "end of dialog" closure. ... the end of the response is. ...
    (comp.lang.java.programmer)
  • Re: async i/o completion routines, threading question
    ... the client does a WebRequest.Createand writes the post to the time the ... server logs receiving it. ... HttpListener stuff on the server side, but 13 seconds to open a connection ... where an initial response from the community or a Microsoft Support ...
    (microsoft.public.dotnet.framework)
  • Re: Client Server
    ... Otherwise, read a file in via a stream, make any required updates, and write ... > myself and compares it to the data that the client has sent to ... My response, though it was very general in nature, assumed exactly what you ... at some point you want the server to read this file in. ...
    (comp.lang.java.help)
  • Re: AS2005 over HTTP - querying via Excel pivot table extremely slow o
    ... For any given client, the slowness increases dramatically with the size ... Excel 2007 as a client seems much faster than earlier versions. ... HTTP using IIS on the same server. ... The delay is between the request and the response. ...
    (microsoft.public.sqlserver.olap)