Jump to content


Photo

Java .nio-ish extension


  • Please log in to reply
2 replies to this topic

#1 <?=$humour?>

<?=$humour?>
  • Members
  • Pip
  • Newbie
  • 6 posts
  • LocationBrisbane, AU

Posted 05 May 2006 - 07:36 PM

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!
What I'd like to see:
- I'd like to see a PHP code checker that has the following line:
55 errors in 13 lines; error thrown [PHP_ERROR_SOD_OFF]; PHP has decided you're too stupid to use it, reformatting hard drive ( \ ).


#2 trq

trq
  • Staff Alumni
  • Advanced Member
  • 31,041 posts

Posted 07 May 2006 - 02:03 PM

Of course it can be done in php. Have a look at the sockets extension. People (including myself) have written web servers in php.

#3 <?=$humour?>

<?=$humour?>
  • Members
  • Pip
  • Newbie
  • 6 posts
  • LocationBrisbane, AU

Posted 07 May 2006 - 02:43 PM

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.
What I'd like to see:
- I'd like to see a PHP code checker that has the following line:
55 errors in 13 lines; error thrown [PHP_ERROR_SOD_OFF]; PHP has decided you're too stupid to use it, reformatting hard drive ( \ ).





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users