<?=$humour?> Posted May 5, 2006 Share Posted May 5, 2006 I've been looking at Java (just research purposes!) recently, especially at the .nio library which has this package called socketchannels, which is cool. Used with channelselectors and managers and all that you can have an application run several socket servers at once and select the most unused one at each request, more or less. What I want to know is, has anyone heard, seen, though about doing this in PHP, I understand that it would only work for CLI or CGI, but still, COOL! Quote Link to comment Share on other sites More sharing options...
trq Posted May 7, 2006 Share Posted May 7, 2006 Of course it can be done in php. Have a look at the sockets extension. People (including myself) have written web servers in php. Quote Link to comment Share on other sites More sharing options...
<?=$humour?> Posted May 7, 2006 Author Share Posted May 7, 2006 Not exactly what I was looking for I'm afraid, I too have written several socket servers and clients in my time. Java's Socket Channel and Server Socket Channel are abstractions of the standard socket libraries, both of which contain inbuilt methods for selectability. I guess you have to know what the Java's .nio library is capable of, cause it's a bit difficult to explain. Basically it means that apparently thousands of socket connections can be made on one or a few threads, instead of a connection/thread. The ServerSocketChannel can select a SocketChannel based on readiness and have it process the request. There's more to it but that's the bit I like. 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.