Jump to content

Java .nio-ish extension


<?=$humour?>

Recommended Posts

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!
Link to comment
Share on other sites

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.
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.