Applets URL connections are not kept alive
0 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Sruli_Ganor
Posted On:   Tuesday, January 14, 2003 12:34 AM

Hi Java gurus, I know the keep-alive issue has been discussed hundreds of times, but I have not found any solution yet. My applet sends many POST requests (10-20 per second) using URLConnection. The server is an IIS ISAPI dll. I specify Connection: Keep-Alive in all the POST requests and the server responses (see trace of one request below). IIS Keep-Alive option is ON. Nevertheless, using netstat I see that many HTTP sockets are created, some 'established' and the rest in 'time_wait' state. The number of sockets equals the number of POST requests. The network sniffer shows that every POST opens another socket from another client port. So, the sockets are still alive, but the applet does not use them but keep   More>>

Hi Java gurus,


I know the keep-alive issue has been discussed hundreds of times, but I have not found any solution yet.
My applet sends many POST requests (10-20 per second) using URLConnection. The server is an IIS ISAPI dll. I specify Connection: Keep-Alive in all the POST requests and the server responses (see trace of one request below). IIS
Keep-Alive option is ON.



Nevertheless, using netstat I see that many HTTP sockets are created, some 'established' and the rest in 'time_wait' state. The number of sockets equals the number of POST requests. The network sniffer shows that every POST opens another socket from another client port. So, the sockets are still alive, but the applet does not use them but keeps open a new socket for each POST!



My applet runs in IE 6.0, with Java Plugin 1.4.1 (the same problem occurs with 1.4.0). I ran the applet's code as a Java application and in AppletViewer. In both cases
only ONE socket is created and is kept alive and used for all the POSTs. This means that my code is basically OK and IIS is configured correctly, but something goes wrong with the plugin or the browser. So what is wrong?



Any ideas would be appreciated

Thanks in advance


			
============================================================
Sample trace of one request/response :

POST /Ariel/IsapiTest.dll HTTP/1.1

Content-type: text/plain
Connection: Keep-Alive
User-Agent: Mozilla/4.0 (Windows XP 5.1) Java/1.4.1_01
Host: 192.147.160.143
Accept: text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2
Content-Length: 194

MESSAGE_TYPE=C020
DESCRIPTION=Get next num
DATA=11111111112222222222333333333344444444445555555555666666666677777777778
88888888899999999990000000000
*CONNID=a4c71b80de98aa4baaae627fa6f83c49

HTTP/1.1 100 Continue
Server: Microsoft-IIS/5.0
Date: Mon, 13 Jan 2003 12:21:33 GMT

HTTP/1.1 200 OK
Server: Microsoft-IIS/5.0
Date: Mon, 13 Jan 2003 12:21:33 GMT
Connection: Keep-Alive
Content-Length: 112
Content-type: text/plain

MESSAGE_TYPE=S021
RESPONSE_NUM=2
DESCRIPTION=Number found in table
*CONNID=a4c71b80de98aa4baaae627fa6f83c49
========================================================
   <<Less
About | Sitemap | Contact