The online racing simulator
Insim - PHP
(4 posts, started )
Insim - PHP
Hi!
I'm using PHP to manage races and quals by InSim but I have 1 big trouble.
When someone is on the server, my PHP script is getting every 30s an TINY packet and it's sending this same packet to LFS to get connection working good.

My problem is when everyone leaves server. When the connections list equals 1 (host) my script after 10-13min is losing connection because LFS isnt sending any packet. It's very uncomfortable because when at night noone is driving I muss get up in the morning to restart InSim or use bash script to do it automatically (manually it's better because bash script isn't working every time)
-
(MariusMM) DELETED by MariusMM
There's a problem. PHPLFS is using socket_read - this function blocks PHP script since something would be send by LFS.
Don't use socket read by itself, use socket select to keep the script from blocking.
-
(DarkTimes) DELETED by DarkTimes
I was using PHPLFS but I'm gonna to write an InSim script with tutorial on lfsmanual.net. PHPLFS is waiting for next packet and if LFS sleeps then PHPLFS won't send anything.
Dygear - I knew about that but I thought I can do a litte modification in PHPLFS.

Dygear - let's look at PHPLFS while you are creating your own PHPInSim because the packet system and Callbacks are very well in PHPLFS.

EDIT: Problem fixed. My PHP InSim works great for 2 days now. Without any problems.

Insim - PHP
(4 posts, started )
FGED GREDG RDFGDR GSFDG