Yes, it does sound kind of weird :)
You could simply use sockets for the
initial connection. That way you won't
need at least one blocked HttpConnector
thread for each active applet client.
Threads are relatively expensive. Also,
you should take into consideration that
certain routers won't let you keep a
connection open indefinitely.

To solve your load-balancing issue, I
guess you could assign a globally unique
ID to each active applet, and have the
load balancer redirect/proxy applet connections
to the right server based on the ID, or have the applet establish an initial
connection with all
the load balanced servers, or get the servers to talk to each other. It
depends on what you can do with the load balancer you're using.

--Jose


---------------------------------------------------------
Message sent using LoudPC - get it now: http://loudpc.com?rid=m0
Use your PC's Outlook(tm) from any Internet browser or web phone.


----- Original Message -----
From: Vjeran Marcinko <[EMAIL PROTECTED]>
Sent: Sunday, February 10, 2002 09:01 AM
To: Tomcat Users List
Subject: Re: Load balancing app context ?


----- Original Message -----
From: "Jose Solorzano" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Sunday, February 10, 2002 2:32 PM
Subject: RE: Load balancing app context ?


>
> What kind of state do you store in those variables?
>
> With multiple VMs, you can store user/session state in cookies, in a
shared
> database or you
> can use an application server.
>
> --Jose

Well, I know it sounds weird, but I'm storing servlet's output stream
in those variables. And than I block this servlet, thus it won't be able to
close its output stream, which is the thing that happens when servlet
thread goes out of its service() method.
This way I have persistent output stream to client. And then all future
HTTP requests can fetch this stored output stream and send some data
back to client. But since I have multiple JVMs, this stored variable
isn't unique anymore, because there are as many variables as there are
JVMs, and each of them has its own servlet instance, right ?
Thing works perfectly with one servlet engine instance, but I guess it
won't do in load-balancing case...
I didn't consider session till now, since client is applet and not browser,
and I'm not sure how good is applet's URLConnection doing with cookies ?

-Vjeran





--
To unsubscribe:   <mailto:[EMAIL PROTECTED]>
For additional commands: <mailto:[EMAIL PROTECTED]>
Troubles with the list: <mailto:[EMAIL PROTECTED]>



--
To unsubscribe:   <mailto:[EMAIL PROTECTED]>
For additional commands: <mailto:[EMAIL PROTECTED]>
Troubles with the list: <mailto:[EMAIL PROTECTED]>

Reply via email to