Olcay Sarioglu wrote:
> I want my clients to get real-time data from the server. I have an idea
> but I am not so sure about that:
>
> develop a java server program that waits for the clients to request
> for the new fresh data. I mean tcp/ip socket programming. This way server
> should have one thread to get data continuously from the source (db or
> another socket) and another thread that keeps track of the clients. This
> second thread should push data to the clients.
> In this alternative my client applets will connect to that server and
> get a new socket number to continue. The difficult think is , I have to
> implement all the session management and security issues.
> Is this architecture a right choice? What could be alternatives? Can I
> use servlets? How?
>
> -- Olcay SARIOGLU
>
You can definitely use servlets for this. At the server end, you would start
a background thread to refresh the data on whatever schedule is appropriate.
The key concept is that the output of the servlet need not be an HTML page.
You could create a bunch of ASCII comma-delimited text, you could return an
XML document, or you could even return a stream of Java serialized objects (if
the client programs are Java also).
If your client programs need to deal with session management and security
issues, you will have to understand how those things are implemented in
servlets, but it's not that complex. I'd suggest starting with one of the
servlet programming books like Jason Hunter's, and read the chapter on
applet-servlet communications.
Craig McClanahan
___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".
Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html