• Forum
  • Doc
  • Screenshots
  • Download
  • Donate
  • Contributors
  • Contact
  • Follow @phpfreechat
  • DEMO
  • Board index ‹ Version 1.x branch ‹ Contributions (v1.x)
  • Change font size
  • FAQ
  • Register
  • Login

Finally a fix for the timeout issues?

Post a bug fix, a new feature, a theme ...

Moderators: OldWolf, re*s.t.a.r.s.*2

Post a reply
5 posts • Page 1 of 1

Postby runebergen » Wed Sep 28, 2011 10:23 pm

Php free chat is AWESOME, but the one issue i see a lot struggle with is the timeout issue, where users time out for no apparent reason..

Been trying my hacks for avoiding that, since its so annoying for the users..

I changed the chat startup in chat.js.tpl.php to this :

Event.observe(window, 'load', function() {
pfc = new pfcClient();
if (pfc_isready) {
pfc.loadChat(pfc_theme);
setInterval(pfc.sendRequest('/update'), 5000);
}

});

And that seems to make the timeout issue gone for all ..
(basically what it does is send a "hidden" command every 5 sec to keep user connected and live in chat)

PLEASE DO NOT ADD THIS BEFORE A COMMENT FROM ONE OF THE PHP FREE CHAT DEVELOPERS OR MODERATORS

I do NOT know if its a bad idea, or too heavy on servers etc..
But at least it works (for me).. and wanted to share it in case it also fixes it for others...
runebergen
Member
 
Posts: 30
Joined: Tue Aug 12, 2008 10:00 am
Top

Postby re*s.t.a.r.s.*2 » Wed Sep 28, 2011 11:44 pm

hi,

Thanks a lot, you are overwriting the parameters timeout, refresh_delay_steps, refresh_delay..

but if it works for other they can use it, 5 seconds isn't much of a stress....

thanks for you help.
Free Singles Chat Rooms No Registration Required
Text and Chat Singles no need to register or app required
Sala De Bate Papo Online Grátis E Sem Cadastro
re*s.t.a.r.s.*2
Support Team
 
Posts: 612
Joined: Wed Sep 24, 2008 4:04 pm
Location: los angeles CA
  • Website
Top

Postby runebergen » Sun Oct 02, 2011 5:46 pm

Ups... there was a tiny error when i shared the script above..
here is the working fix for timeouts.. no more timed out users in chat

I changed the chat startup in chat.js.tpl.php at the Event.observe(window, 'load', function() to this :

Code: Select all
Event.observe(window, 'load', function() {
  pfc = new pfcClient();

  fixtimeout = setInterval("pfc.sendRequest('/update')", 5000); // keep users alive - 5sec updates (set what u want)

 if (pfc_isready) {
 pfc.loadChat(pfc_theme); // loads the chat
  }
 
});
runebergen
Member
 
Posts: 30
Joined: Tue Aug 12, 2008 10:00 am
Top

Postby re*s.t.a.r.s.*2 » Sun Oct 02, 2011 6:35 pm

Hi,

the code is the same as previously one, the only changes are that you arent requiring that pfc_isready to be true, but in fact upon loading the chat is set always to true...

I have tested the fix and same behavior for me, but I congratulate for help in this regard..

regards.
Free Singles Chat Rooms No Registration Required
Text and Chat Singles no need to register or app required
Sala De Bate Papo Online Grátis E Sem Cadastro
re*s.t.a.r.s.*2
Support Team
 
Posts: 612
Joined: Wed Sep 24, 2008 4:04 pm
Location: los angeles CA
  • Website
Top

Postby runebergen » Sun Oct 02, 2011 10:41 pm

Unfortunately ..
it doesnt seem to entirely fix it, it does seem to keep users alive longer though, and far better on my server.

But there are still timeouts (that shouldnt happen), and quite a bit of it ... :(
Last edited by runebergen on Sun Oct 02, 2011 10:42 pm, edited 1 time in total.
runebergen
Member
 
Posts: 30
Joined: Tue Aug 12, 2008 10:00 am
Top


Post a reply
5 posts • Page 1 of 1

Return to Contributions (v1.x)

Who is online

Users browsing this forum: No registered users and 7 guests

  • Board index
  • The team • Delete all board cookies • All times are UTC + 1 hour
Powered by phpBB® Forum Software © phpBB Group
Sign in
Wrong credentials
Sign up I forgot my password
.
jeu-gratuit.net | more partners
Fork me on GitHub