Server send messages to specific browser and more...

Z

zorhel

Hi.
My clients will be IE, Mozilla and Opera in
a Windows and *nix OS.

So, my web app need to, from a server, send messages to a specific client
(browser), send messages for all clients, redirect a client to another page.
In other way, a client will be able to send messages to another client,
throw the server.

These are the first funcionalities.

Thanks.

Zorhel
 
M

Marina

This is not possible, as HTTP is a connectionless protocol. Meaning that
once a request has completed, the client and server stop talking to each
other, and that's it.

Web application just can't function exactly like a windows application can.

The only way you can accomplish this would be to either have the client
browser periodically poll the server for messages, etc, or to have some sort
of ActiveX capable of maintaining a constant connection to the server.
 
Z

zorhel

Thanks Marina.
Your opinion is my opinion too, think about Active-X, mozilla can't
implement that.

My boss tell me something about XMLHTTP?
Someone knows if this thing helps me in any way?

Thanks.
Zorhel
 
M

Marina

You can use XMLHTTP. This can do server side calls via client side
javascript. However, this has nothing to do with the server sending
messages to clients. This is still the client polling the server all the
time for new messages. It just does so without a server side post back, but
with just a client script - so it is seamless to the user and has no page
refreshes.

Also, I believe XMLHTTP only works with IE, so you would be out of luck for
other browsers if you wish to support those.
 
Z

zorhel

So Marina, XMLHTTP works only in one direction, client to server ok?
Then, in the theory, I can send message from a client to another. I send the
message from a client to a server, using xmlhttp and the server send to the
specific client.
But server redirect the client navigate page and server send message to
client I can't using XMLHTTP.

Do you have any code or sample of xmlhttp?

And if I pool the server for messages, how can I do the server and the
client?
Do you have samples to?
I guess, in the client, I will be some kind of frame, and refresh the page
after a time, looking in the server for news.
But how?
Thanks.

Zorhel
 
M

Marina

No, client sends message to server. But then how does the server send the
message to another client? It can't. Not until that other client makes a
request to the server for something - in which case the server can give it
the information. But not until the second client initiates the request. In
all cases, the client always initiates the request - the server can only sit
there and wait.

You can have a timer go in your client side script. to trigger and XMLHTTP
call to the server to poll for incoming messages.

I don't have any samples, but you can use google to find some, as well as
complete documentation of XMLHTTP.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,764
Messages
2,569,565
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top