elmario Posted September 4, 2010 Share Posted September 4, 2010 Would it be possible to create a passive socket server using php, for a client-server php app, that runs as some sort of daemon? I understand that you probably can't understand much of what I mean, but I hope you understand enough to help me in some way. PHP APPLICATION - > APPLICATION SERVER - > DATABASE(S) Explanation: Each instance of the PHP application would connect to the "Application Server" and use it to fetch information and perform some commands. Could this be done using sockets ? Simple examples would help Thank You! Quote Link to comment https://forums.phpfreaks.com/topic/212554-php-custom-application-server/ Share on other sites More sharing options...
ignace Posted September 5, 2010 Share Posted September 5, 2010 Yes it's possible to let PHP run as a "daemon" using the command: set_time_limit(0); However as PHP is not designed for such applications it may be best to look for other technologies that better fit the bill like Flash. The new ActionScript comes with socket server support like ElectroServer (which is specifically designed for hosting Flash-based MMO games). The same company (ElectroTank) also released a book explaining every bit you need to get your own game up and running (ActionScript for Multiplayer Games and Virtual Worlds). Quote Link to comment https://forums.phpfreaks.com/topic/212554-php-custom-application-server/#findComment-1107413 Share on other sites More sharing options...
Alex Posted September 5, 2010 Share Posted September 5, 2010 As ignace stated, yes it is possible. For the client you would need to use HTML5 websockets, which aren't implemented, or fully implemented, in most browsers, yet. It's also worth noting that from personal experience I've learned that using PHP for a socket server scales horribly; even at a fairly low level. Quote Link to comment https://forums.phpfreaks.com/topic/212554-php-custom-application-server/#findComment-1107417 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.