Thanks Len,
And what of other protocols? Are sockets then required? What are
some other protocols that might be used to push/pull data? (off Tomcat I
know ;))
Paul.
-----Original Message-----
From: Len Popp [mailto:[EMAIL PROTECTED]
Sent: Thursday, 11 August 2005 11:52 AM
To: Tomcat Users List
Subject: Re: data push
If you send the data via HTTP, then Server B processes that HTTP request
just like any other. It's exactly the same as if a user sent a POST request
by typing the data into a form and clicking Submit.
Server B receives the POST request and executes the appropriate servlet to
process it.
--
Len
On 8/10/05, Paul Wallace <[EMAIL PROTECTED]> wrote:
> Hi and thanks for that,
> That's the crux of my question! The data (I am unsure of the
> protocol it is delivered in) is sent at random points in time i.e not
> from any request. I wish to create particularly the client (server B)
> that listens for this data. I (mistakenly) mentioned server A to mimic
> the data pushes. I can write something to fire off data at
> intermittent times, but I am more interested in how to capture that
> data, when no request has been made. This is the reason why I first
questioned on Sockets.
> Perhaps I should have been clearer from the off!
>
> thanks
>
> Paul.
>
> >Does that mean it's done in response to a user request (i.e. in a
> >servlet)
> or asynchronously (i.e. once an hour, or when a buffer fills up)?
>
> It's easy to call your data-sending code from a servlet. If you want
> to call it asynchronously (outside of a user request) then you'll have
> to create a separate thread to do it. The easiest way is probably to
> use a java.util.Timer.
>
> 5. To start and shut down a thread properly, you have to use a
> ServletContextListener. Start the thread (or Timer) in the
> contextInitialized event and kill it (or call Timer.cancel) on
> contextDestroyed.
>
> Hope this helps!
> --
> Len
>
> On 8/10/05, Paul Wallace <[EMAIL PROTECTED]> wrote:
> > Hi All,
> > I would like server A (TC 5.5) to 'push' streams of data to
> > server B (TC 5.5) at random points in time, and for server B to
> > accept the data when it is received. This is not using request /
> > response, hence I am new to this topic. A couple of questions - what
> > protocol(s) can be used, HTTP? Can anyone point me towards a
> > resource of this nature please? I understand sockets are in the picture
- also new to me.
> >
> > Thanks
> >
> > Paul.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]