C
Chris Smith
Pete Barrett said:Sometimes it has to be. There's one particular server I have to
connect to and send XML via an HTTP request. If I assemble the
request, headers and body together, and then flush the stream, it
doesn't work (reading the response times out); if I write the headers,
then flush, then write the body, then flush, it works. Don't ask me
why - it's their server!
I can tell you why with a fair degree of certainty. The programmers who
wrote the server didn't bother to learn TCP. If you send header and
body content in one message, then they get confused and don't deal with
it properly.
The technique you've chosen is a good one (I'd also set TCP_NODELAY on
the socket to be extra safe), and probably the only reasonable response.
But at least you can understand what's wrong. Perhaps you can even let
them know that their server is broken.
--
www.designacourse.com
The Easiest Way To Train Anyone... Anywhere.
Chris Smith - Lead Software Developer/Technical Trainer
MindIQ Corporation