Rustywolf Posted May 22, 2010 Share Posted May 22, 2010 Is there a way to do this? I have created simple PHP Sockets, but have found no resources about async btw, if you didnt know, async is basically holding more than one connection. Quote Link to comment Share on other sites More sharing options...
Rustywolf Posted May 22, 2010 Author Share Posted May 22, 2010 I dont care if i shouldn;t bumb, i need this solved. and it isn't getting anywhere. Quote Link to comment Share on other sites More sharing options...
kenrbnsn Posted May 22, 2010 Share Posted May 22, 2010 Take a look at http://stackoverflow.com/questions/1432477/can-php-asynchronously-use-sockets Quote Link to comment Share on other sites More sharing options...
leehanken Posted May 22, 2010 Share Posted May 22, 2010 Php doesn't allow the asynchronous socket callback functions of the same type used in other languages, so you need to write a loop that checks all the multiple connections and responds as and when they need attention. Sockets can be told to act asynchronously with socket_set_nonblock. This will stop them pausing the code when a read or write is performed, if it can't then the read/write function just fails and moves on instead of waiting. There is also a function socket_select which simultaneously monitors whole arrays of sockets for read/write/exceptions. Quote Link to comment 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.