This post was last edited by stneo1990 on 2013-08-03 15:48:51
PHP-based Web real-time chat program, 1 to 1 live chat online, not 1 to many, and not more than 1
Sending messages is simpler because there are client commit operations that can identify
But what should be better to receive messages?
My idea is: Can the receiver only send the message after the sender to perform the receive operation, when the sender does not send a message, the receiver will not request data.
In addition, a user is both the sender and the receiver, mainly depending on the user's current operation
Reply to discussion (solution)
Look what you're talking about. The idea of submitting in a general Web page
In the sky or consider long connection +socket/websocket bar
Look what you're talking about. The idea of submitting in a general Web page
In the sky or consider long connection +socket/websocket bar
At present, I have found three kinds of information (I do not know if there are duplicates):
1. Long connection
2. Polling
3, WebSocket
Do not know whether these three kinds of can all accomplish I say goal?
Long connection +socket If no controls are implemented in the browser it is not easy
WebSocket is HTML5, not all browsers are supported, only newer versions of the can try
Ajax polling online There are examples, you can search
Long connection +socket If no controls are implemented in the browser it is not easy
WebSocket is HTML5, not all browsers are supported, only newer versions of the can try
Ajax polling online There are examples, you can search
Well, then it should be the Ajax poll, and that case, it should be a long poll.