java - not getting any response from server, but able to get response from telnet -
i fist connecting through vpn client able telnet , able response when paste request string on terminal.
same request if trying through java program, not getting response.
i can see using netstat there established tcp connection when try through java. tcp 10.2.2.22:1154 184.23.23.61:7565 established
here java client code sends request.
socket client = new socket(serverip, port); outputstream out = client.getoutputstream(); inputstream in = client.getinputstream(); string test = "tue231363**"; stringbuffer response = new stringbuffer("response : "); out.write(test.getbytes()); out.flush(); int c; system.out.println("waiting response.......>>>>>>>>>>>>>"); while ((c = in.read()) != -1) { if (isendofresponse(c)) break; system.out.print((char) c); response.append(c); } client.close(); system.out.println(response.tostring());
every time after few minutes [5-6 min] exits without response.
i bit new networking, can suggest missing.
i assume telnetting same ip address , port trying connect java.
the fact telnet
connects, , client appears connect imply the server running, , has created bound serversocket
on right ip / host. calling accept
properly. seems server either not reading request @ all, or failing send response.
either way, problem on server side ... , there's not can without seeing server-side code.
Comments
Post a Comment