Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > Tomcat/JSP - multiple concurrent connections from same client

Reply
Thread Tools

Tomcat/JSP - multiple concurrent connections from same client

 
 
Joe
Guest
Posts: n/a
 
      10-22-2003
Hi,

I was attempting to do some testing of some thread based code, so had
a JSP with a deliberate delay loop inside it so that I could lock
something for a period of time, when I noticed the following.

I opened three webrowsers (IE) on my Windows XP box and pointed each
in turn at the following JSP page (being served directly by Tomcat
v4.1.27 on port 8080 on a Linux box):

<%@ page import="my.log.package.*" %>
<%
int waitfor = 0;
String timer = request.getParameter("wait");
if (timer != null) waitfor = (new Integer(timer)).intValue();

Log.info("jsp", "I'm here and waiting: " +
request.getParameter("id"));
%>

<html>
<head>
<title>Thread Test</title>
</head>
<body>

<p>Just a simple thread test.</p>

<%
if (waitfor > 0){
for (int i = 0; i < waitfor * 1000000; ) { i = i + 1; }
}

Log.info("jsp", "... finished " + request.getParameter("id"));
%>

</body>
</html>

--------

So the browsers were pointed at:

threadtest.jsp?id=1&wait=5000
threadtest.jsp?id=2&wait=5000
threadtest.jsp?id=3

If I start the first two off so that they're both waiting for the loop
to finish before getting their pages, and then set the third going, it
blocks until one of the others returns and then comes through.

The logs (my custom log) confirms this.

I've tried it on another XP machine as well.

So I then did the same test, but with the first two URL's accessed on
one machine, and the third accessed from another concurrently, and all
behaved as you might expect - ie. the third received the page
immediately.

Anyone any ideas what's going on? Is there some kind of
connection-per-machine thing that I don't know about?

Cheers,
Joe
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Pix 501 and Concurrent VPN Connections jaylucasaustin.rr.com Cisco 3 01-29-2006 10:29 PM
problems locating the concurrent EDU.oswego.cs.dl.util.concurrent package Pep Java 6 08-16-2005 07:26 AM
Re: [Twisted-Python] Limiting number of concurrent client connections Jp Calderone Python 0 06-28-2005 02:10 PM
PIX 501, concurrent connections. gooofoofs Cisco 1 04-14-2005 08:07 AM
concurrent connections =?Utf-8?B?c3RlcGhlbg==?= ASP .Net 9 05-03-2004 02:36 AM



Advertisments