We have an application j2ee , which has socketClient utility communicating to the legacy system sending byte of data
and reading the data
We face a latency in reading the response.
a. We wrote a standalone and tried, the legacy system is responding in 1 or 2s and we are processing immediately
the same request when hit from a servlet or application, it is sending correctly, but response reading takes time.
How to analysis or trouble shoot
A. Jboss 4..0.5 GA
Socket - Plain SocketClient . java.net.Socket
Wireshark (http://www.wireshark.org/) - use it to monitor what is really being sent across the network. If there are retries or other things like that, Wireshark will show them to you.
Fiddler (http://www.telerik.com/fiddler) - it will graphically show you the response timings for requests. I find this tool especially handy to find issues with slow web pages (and even slow REST API requests).
You should run the tools on your standalone app that is working correctly first so that you will know what a good result looks like, Then run them with the servlet environment.