Diego,
It sounds like you want to do two things: open a persistant connection to a
web server, and pool the connection, just like a JDBC connection in jRun. I
don't think you'll be able to do it without building/finding an HTTP
pooling and connection manager.
The specs for HTTP 1.0 (KeepAlive) and 1.1 (Persistent Connections) can
both support the ability to send multiple requests across a single HTTP
session. Browsers use it to speed up page requests (with multiple elements
per page) so they are not constantly opening and closing a socket. The
connection is kept open while requests are being made. The browser (client)
can close the connection or the server can close the connection by keeping
track of the amount of time between requests and/or the number of requests
made per session (set by the server) until it closes.
The HTTP server has to be configured to allow it to happen and it usually
only works with files of known length. (taken from apache.org : This means
that most CGI scripts, server-side included files and directory listings
will not use the Keep-Alive protocol.) You're not only going to have to
find a way to keep the connection open on the client side, you're going to
have to find a way from keeping from closing on the server side by
constantly making requests.
Just for clarification: Is this from an applet or from a servlet?
Pardon my verboseness,
-- Brett
P.S. There is a good (albeit slightly outdated) article about general
connection pooling (using JDBC as an example) at
http://www.webdevelopersjournal.com/columns/connection_pool.html
At 07:31 PM 12/28/2000 -0500, you wrote:
>Thank you very much. I want to beable to send a new query string without
>opennening a connection each time
>
>So when someone press a button on my applet it sends
>a get like http://localhost:90/servlet/process?id=344
>and the next time it sends http://localhost:90/servlet/process?id=34334
>
>but I don't want to open a connection all the time I just want to
>use the same connection is this possible ?
>
>
>Diego
>
>------Original Message------
>From: "Anthony T. DeBonis" <[EMAIL PROTECTED]>
>To: JRun-Talk <[EMAIL PROTECTED]>
>Sent: December 21, 2000 10:03:30 PM GMT
>Subject: RE: URL Connection Cache
>
>
>What type of data are you going after? Sounds like html if your using a
>URL.
>
>If so try this (great for syndicating in content from another site) :
>
>
>URL url = new URL ("http","www.allaire.com","/index.cfm");
>
>
>HttpURLConnection c = (HttpURLConnection) url.openConnection();
>
>
>InputStream in = c.getInputStream();
>
>byte buf[] = new byte[4096];
>int cnt = 0;
>while ((cnt = in.read(buf)) > 0)
>out.print(new String(buf, 0, 0, cnt));
>out.println("-");
>in.close();
>
>
>
>
>
>
>-----Original Message-----
>From: Diego Diego [mailto:[EMAIL PROTECTED]]
>Sent: Thursday, December 21, 2000 3:40 PM
>To: JRun-Talk
>Subject: URL Connection Cache
>
>Greeting,
>
>I have a servlet that calls a cgi application on a seperate machine to
>recieve data . I open a url connection and get the data and send it to the
>applet. I know that DataBase Connection pooling is possible and built into
>JRUN , Do they have something Build into JRUN that would create a pool of
>connection to a URL that I can use. If not anyone know where I can read
>about creating my own ?
>
>Diego
>Belize C.A
>
~~~~~~~~~~~~~ Paid Sponsorship ~~~~~~~~~~~~~
Get Your Own Dedicated Win2K Server! Instant Activation for $99/month w/Free
Setup from SoloServer PIII600 / 128 MB RAM / 20 GB HD / 24/7/365 Tech Support
Visit SoloServer, https://secure.irides.com/clientsetup.cfm.
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists