by JScript February 23rd 2015, 3:20 am
@RsS.YuGi
I did several tests right now in a connection with the following speeds:
Incoming Transfer:Bandwidth: ISDN 1b
Kbps: 128
Outgoing Transfer:Bandwidth: ISDN 1b
Kbps: 56
As you can see, is a very slow connection, but even so the delay was completely acceptable!
There is only one request made by the following function:
Chatbox.prototype.listenAnd her return is something like this:
- Code:
{
"url": "http:\/\/f36.dnspro.org\/sub\/cb.366bc21",
"lastModified": "Mon, 23 Feb 2015 02:02:33 GMT",
"tag": "0"
}
In the previous version (chatbox7.js) the return of the messages was much higher because the included HTML messages, now in the new version (chatbox8.js) the return of chat messages is in JSON format, which greatly minimized the return!
See an example JSON content of a request in a chat:
- Code:
{
"users": [{
"online": true,
"id": "1",
"username": "JScript",
"admin": true,
"userLevel": "1",
"chatLevel": "2",
"color": "#000099"
}],
"connected": true,
"messages": [{
"userId": "-10",
"msg": "Messages cleared by JScript",
"time": "1424656957",
"username": "JScript",
"action": "clear",
"chat_level": null,
"user_level": null,
"user_allowavatar": null,
"user_avatar_type": null,
"user_avatar": null,
"date": "22 Feb 2015",
"datetime": "19:02:37 22\/02\/2015"
}, {
"userId": "1",
"msg": "<span style=\"color: #333333\">Test 01<\/span>",
"time": "1424656960",
"username": "JScript",
"action": "msg",
"chat_level": "2",
"user_level": "1",
"user_allowavatar": "1",
"user_avatar_type": "2",
"user_avatar": "http:\/\/autoitbrasil.com\/forum\/uploads\/av-89.png",
"date": "22 Feb 2015",
"datetime": "19:02:40 22\/02\/2015",
"user": {
"color": "#000099",
"admin": true,
"avatar": "http:\/\/autoitbrasil.com\/forum\/uploads\/av-89.png"
}
}, {
"userId": "1",
"msg": "<span style=\"color: #333333\">Test 02 - JS<\/span>",
"time": "1424656964",
"username": "JScript",
"action": "msg",
"chat_level": "2",
"user_level": "1",
"user_allowavatar": "1",
"user_avatar_type": "2",
"user_avatar": "http:\/\/autoitbrasil.com\/forum\/uploads\/av-89.png",
"date": "22 Feb 2015",
"datetime": "19:02:44 22\/02\/2015",
"user": {
"color": "#000099",
"admin": true,
"avatar": "http:\/\/autoitbrasil.com\/forum\/uploads\/av-89.png"
}
}]
}
Note that only contains simple texts, nothing else!
I need more information with details,
JS