I have the following code:
ServerSocket ss = new ServerSocket(2351);
Socket s = ss.accept();
InputStreamReader in = new InputStreamReader(s.getInputStream());
writer = new PrintWriter(s.getOutputStream());
writer.flush();
cbuf = new char[buf_length];
in.read(cbuf);
inputLine = new String(cbuf);
I ran four consecutive sends to my server and when I debug the above code it runs correctly three times. The other time the following is my inputLine that is read from the socket:
POST /record HTTP/1.1
Content-type: application/soap+xml;charset="utf-8";action=""
Accept: application/soap+xml, multipart/related, text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2
User-Agent: JAX-WS RI 2.1.5-b03-
Host: localhost:2351
Connection: keep-alive
Content-Length: 2197
And the content is just 2197 whitespaces instead of a 2197 length content. Its really weird and I am stuck. Any help is appreciated. Thanks.