Re: [PHP] socket multithreading problem
Ümit CAN wrote: I use PHP socket programming and I wish multithreading operation of the socket . Don't use PHP, use C - it'll save you a lot of trouble in this context. -- Per Jessen, Zürich (15.4°C) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] socket multithreading problem
On 7/27/10 7:04 AM, Ümit CAN wrote: I use PHP socket programming and I wish multithreading operation of the socket . When I have many requests on this socket , before the first one request is anwered , the second request is not aswered till the first one is finished. How can both requests work together without waiting each other ? I assume you mean you have multiple sockets and not just one? If it is just one, you just need to write a little state machine that keeps track of your requests since only one thing can happen at a time on a single socket. If you have multiple sockets you should be looking at http://php.net/socket_select and not threads. Threads and/or pcntl processes would be a very inefficient way to deal with something as simple as reading messages asynchronously from many sockets. -Rasmus -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] socket multithreading problem
Hi All; I use PHP socket programming and I wish multithreading operation of the socket . When I have many requests on this socket , before the first one request is anwered , the second request is not aswered till the first one is finished. How can both requests work together without waiting each other ? __ ESET Smart Security Akıllı Güvenlik tarafından sağlanan bilgiler, virüs imza veritabanı sürümü: 5316 (20100727) __ İleti ESET Smart Security Akıllı Güvenlik tarafından denetlendi. http://www.nod32.com.tr