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. Link to comment https://forums.phpfreaks.com/topic/202569-async-php-sockets/ 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. Link to comment https://forums.phpfreaks.com/topic/202569-async-php-sockets/#findComment-1061937 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 Link to comment https://forums.phpfreaks.com/topic/202569-async-php-sockets/#findComment-1061938 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. Link to comment https://forums.phpfreaks.com/topic/202569-async-php-sockets/#findComment-1061941 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.