FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » chat on web, Ajax ?
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
Re: chat on web, Ajax ? [message #177165 is a reply to message #177157] Fri, 24 February 2012 15:48 Go to previous messageGo to previous message
The Natural Philosoph is currently offline  The Natural Philosoph
Messages: 993
Registered: September 2010
Karma:
Senior Member
sl@exabyte wrote:
> Hi folks.
>
> I thought I have gathered all pieces I need, then suddenly I realise there
> is still one problem.
>
> I am implementing chat on the web, ie on a browse. On browser, I can only
> use javascript.
You coudl poll the server using a whole page or a framethereof.

Thats all javascript does, but it does it a bit more efficiently.

So the problem is what method to use to listen for incoming
> data.
>
> Ajax ? I am just wondering; Ajax does not seem to bother about port, I mean
> the standard method is "open socket at server, port 8888...".
>
so?
> Of course, when data is sent to a php file on server, it must be port 80.
>

not always.

Yiu can specify any port you want in a url.

General form of url is

"Http:" - the protocol to use
"Mywebserverg.org" a resolvable dns location on the internet.
"/mydirectory.myfile.ext" where on the server teh file is (virtually)
located and some hints in ext as to how the file is to be processed
before being sent
"?param=value&param2=valeu2..." GET variables to be passed to the script
if any
":port number" the port to connect to at the remote end.


So you can set up a web server on any port you like and access it with a
special URL.


> Is this the only way on a browser ?
>

All methods are essentially polling and client initiated. The
differences lie in what mechanism you use to poll, and how much of the
page or frame you download.

So at the crudest end a meta refresh tag will reload the whole page, or
a frame within a page. A javsacript reload can do te same, but it can
request and even smaller block of data and rebuild part of te page with it.

Ajax is just a way of doing that with a bit less overhead IIRC.

All can be vectored to any server port you like.

> Thanks.
>
>
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: FastCGI & PHP
Next Topic: PHP socket and NAT
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Wed Nov 27 03:51:45 GMT 2024

Total time taken to generate the page: 0.04594 seconds