Pergunta

Consider the case in which you want to send text back and forth between computers. (This could be a 1-to-1 conversation or a 1-to-many conversation. Computers could also include smartphones.)

How may one create this in general? For instance, do you push messages by making all parties into lightweight servers that take requests? (I'm particularly confused about this pushing part.)

What specific software, protocols, and/or frameworks are used in practice.

Foi útil?

Solução

It is common to employ comet (see http://en.wikipedia.org/wiki/Comet_(programming)) via a server such as Twisted. See Choosing and deploying a comet server for a more indepth discussion.

Other options include using RTFMP using a server such as Red5

Outras dicas

XMPP is a widely used protocol for implementing chat functionality, so you might want do dig deeper into it. IRC is another one, so read on it.

Aside from that, there are usually two ways to implement chat via HTTP: Long polling and AJAX polling (every second or so).

The next "big" thing that could simplify implementation and reduce bandwidth are web sockets.

Facebook's chat is implemented in Erlang, for example.

As you see, there are many technologies, frameworks and languages available for chat implementation, so you'll have to do some research and choose what you think is the best bet for you.

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top