Slashdot Mirror


phpstack - A TCP/IP Stack and Web Server in PHP

Adam Dunkels writes "Following the trend of writing 'inappropriate' programs in the PHP scripting language, I have written a small TCP/IP stack and a web server entirely in PHP. It is extremely stripped down: the IP stack only implements the most basic functionality required for running the web server and the web server cannot handle pages larger than 1.5k. Nevertheless, the stack is able to support an unlimited number of simultaneous TCP connections and the web server has support for PHP scripting. A live demonstration server is up and running the phpstack software."

61 of 295 comments (clear)

  1. Unlimited connections, really? by zeux · · Score: 5, Funny

    The server only allows very small HTML pages and pictures, but it is able to support an unlimited amount of simultaneous connections.

    You shouldn't have said that here. We are about to brute test this 'unlimited amount of simultaneous connections' thing.

    1. Re:Unlimited connections, really? by ernstp · · Score: 5, Funny

      Must Click Link To Experimental Webserver, Must Click...

    2. Re:Unlimited connections, really? by PugMajere · · Score: 2, Insightful

      Amazingly, it was still up when I posted this.

      Fairly slow, but still rather impressive.

    3. Re:Unlimited connections, really? by requim · · Score: 5, Funny
      You shouldn't have said that here. We are about to brute test this 'unlimited amount of simultaneous connections' thing.

      I believe that was his point (Why not have slashdot do your load testing..)
    4. Re:Unlimited connections, really? by gl4ss · · Score: 4, Funny

      "Read more about the phpstack on its home page:

      http://www.sics.se/~adam/phpstack/

      You are visitor number 3241 and your IP address is"

      thats part of the page I got.

      --
      world was created 5 seconds before this post as it is.
    5. Re:Unlimited connections, really? by ultranova · · Score: 2, Interesting

      I was the visitor number 7532, and stiiilll goooiiinnggg!!!!

      Gotta admit, i'm impressed :). Even if the pictures don't ... wait, they just loaded. All of them. From a server in the middle of a slashdotting. Implemented in a scripting language.

      Now I'm impressed :).

      --

      Forget magic. Any technology distinguishable from divine power is insufficiently advanced.

    6. Re:Unlimited connections, really? by Gherald · · Score: 2, Interesting

      and I'm #11651... kinda impressive, yeah.

      But I want to see them try doing this on a weekday at about 1pm EST =)

    7. Re:Unlimited connections, really? by ericspinder · · Score: 2, Informative

      I was # 20526, not bad, I even checked the server statics. Of course it only seems to show up those two pages.

      --
      The grass is only greener, if you don't take care of your own lawn.
  2. That is a VERY limited system.... by Anonymous Coward · · Score: 4, Informative

    ... the web server cannot handle pages larger than 1.5k

    Uhh, I guess that's one way to survive a slashdotting. :-)

    But, seriously, your demo doesn't even parse URLs; it is just hard-coded to send out a pre-written response on different ports:

    http://193.10.67.151:8080/ -- Main page
    http://193.10.67.151:8081/ -- Picture of a computer
    http://193.10.67.151:8082/ -- PHP Powered logo
    http://193.10.67.151:8083/ -- Picture of some code
    http://193.10.67.151:8084/ -- Stats

    Combined with the 1.5KB limit, that seems rather half-baked to me.

    You are basically reading just enough of the TCP/IP info to get the source IP address and port, running a different script depending on which port, then packaging the output into a single TCP/IP packet destined for that IP address and sending them out over the network.

    I am rather sure the 1.5KB limit is because you didn't figure out how to deal with packet fragments, for example. So there's no way to raise that limit without rewriting the TCP/IP code. Not cool.

    1. Re:That is a VERY limited system.... by Fearless+Freep · · Score: 2, Funny

      Another story about something being done in PHP that ends up not being quite as impressive as the headline led to believe?

    2. Re:That is a VERY limited system.... by Doppler00 · · Score: 4, Insightful

      Yeah, writing a web server is "inappropriate" languages is pretty easy. As long as you can send bytes out of a port, it's pretty easy.

      I once wrote a webserver for an industrial microcontroller using some obscure language called "optoscript". But at least I made sure that I only needed to connect to one port to access different pages.

    3. Re:That is a VERY limited system.... by jackshck · · Score: 4, Informative

      get over it man. it specificaly says

      this code is not meant to be taken too seriously, it is just a quick and dirty proof-of-concept hack written in about 3 hours.

      could you do better?

      --
      Charles Wyble All around tinkerer
    4. Re:That is a VERY limited system.... by igrp · · Score: 5, Insightful
      Hmm... To quote the server's main page:

      Welcome to the phpstack demo server! phpstack is a small TCP/IP stack and web server written in PHP. It is a quick and dirty proof-of-concept hack and shouldn't be taken too seriously.

      Well, it clearly says it's a PoC hack so why not cut this author some slack? To be perfectly honest, I think this is rather impressive in more than one way. Sure, this isn't exactly a novel idea but that wasn't the point. It clearly is a show of flexibility. Php wasn't designed with these kinds of applications in mind, yet it seems to handle this kind of stuff impressingly well.

      Also, it testifies to the fact that thinking outside the box is a good thing. I mean, come on, what would you rather see yet another mail client or some cool project that makes you go "hmm, how come I never thought of this"?

    5. Re:That is a VERY limited system.... by Fearless+Freep · · Score: 5, Insightful

      Yeah, I wrote a quick and dirty proof of concept distributed object client/server in Python in about two hours, but I wouldn't post it to slashdot. Quick and dirty proofs of concepts are what progreammers do every day...so what?

    6. Re:That is a VERY limited system.... by nlh · · Score: 3, Insightful

      That is a typical obnoxious-geek response and should be modded as such.

      Before you call someone else's interesting project "half-baked" and point out that he "didn't figure out" things (implying that you, however, did), why don't you go post YOUR php-based TCP/IP stack and webserver that DOES deal with the issues you mentioned. Then, you can freely criticize his work as much as you'd like, pointing out the solutions instead of highlighting the problems.

      Until then, you should consider keeping comments like that to yourself.

    7. Re:That is a VERY limited system.... by Anonymous Coward · · Score: 2, Insightful

      could you do better?

      Yes. First, since I know TCP/IP, I would have designed around the 1.5KB limit initially, by ensuring that TCP/IP could actually send out multiple packets on one connection, rather than just one. And, second, I certainly would have it parsing URLs, for example. After all, we're talking PHP here, which has much of the string processing capabilities of Perl (preg_match, for instance). It's not a difficult for a good programmer.

    8. Re:That is a VERY limited system.... by Thomas+Charron · · Score: 4, Interesting

      Interesting concept..

      So, basically, you can ONLY critisize something if you managed to rip the idea and make your own..

      Ever written an OS?

      Wait. Have you ever written an automated bot to post slashdot comments? If no, then you must STFU, as you have not done it yourself..

      Shesh..

      --
      -- I'm the root of all that's evil, but you can call me cookie..
    9. Re:That is a VERY limited system.... by Fearless+Freep · · Score: 2, Interesting

      I'm sure you can write a TCP/IP stack in a turing machine, but why bother it's only vain attempts at glorifying a language which was perfectly fine in the area it was designed for.

      This is the kinda stuff programmers do all the time when they are bored or playing around or trying stuff out. I'm not surprised someone did it, I'm just surprised it was considered worth telling anyone about. It's about as newsworthy as posting your homework solutions

    10. Re:That is a VERY limited system.... by Anonymous Coward · · Score: 2, Informative

      Well, it clearly says it's a PoC hack so why not cut this author some slack?

      Well, how about because how he tried to "trick" us into thinking it was a real webserver? Notice all the URLs on his site have fake pieces on the end to make them look like real URLs? http://193.10.67.151:8084/stats.php for instance. The stats.php bit is part of the deception.

      In fact, his "web" server doesn't case WHAT data is sent to those ports, valid URL request or not. As soon as a single packet is sent to it, it sends its one-packet reply. He's just lucky that most web browsers happen to fit their requests into one packet, and don't hang or give errors when the rest of the packets making up their request aren't properly acknowledged.

    11. Re:That is a VERY limited system.... by sg_oneill · · Score: 2, Interesting

      I think its damn cool myself.

      So what if theres a page name being passed back. Compliance perhaps? Eh. Its a finishing touch or an unfinished feature.

      Get over it! Its the TCP stack that makes this baby interesting.

      --
      Excuse the Unicode crap in my posts. That's an apostrophe, and slashdot is busted.
    12. Re:That is a VERY limited system.... by fbjon · · Score: 2, Funny

      What? You have my homework solutions?

      Post Immediately!

      --
      True confidence comes not from realising you are as good as your peers, but that your peers are as bad as you are.
  3. Ouch by Pikhq · · Score: 2, Interesting

    The thing has a hit counter, currently at 200. 2,000,000 anyone?

    --
    echo "rm -rf ~/* ; echo "echo "Exit" ; exit" > ~/.bashrc ; exit" > ~user/.bashrc
    1. Re:Ouch by jx100 · · Score: 5, Funny

      "You are visitor number 1339"

      dammit, if I was only 2 users earlier...

  4. Alright. by whiteranger99x · · Score: 5, Funny

    Ok everyone, get it out of your systems already! :P

    "whoa 2 comments and it's already slashdotted"
    "whoa dude, shouldn't have let slashdot post your server!"
    "Imagine a beowulf cluster of these guys"

    And i'm sure you can figure out more Slashdotisms people *smirks*

    Seems pretty cool at any rate

    --
    Join the TWIT army now!
    1. Re:Alright. by Leffe · · Score: 2, Funny

      "Seems as if the demo server is running phpstack."

  5. ouch... by zoloto · · Score: 5, Funny

    unlimited number of simultaneous TCP connections

    To the tune of Queen:
    Another one bytes the dust!

    1. Re:ouch... by Sir_Real · · Score: 5, Funny

      Well... You really were asking for it...

      With apologies to the late F.M.

      Php is a scripting language
      not a layer three network stack
      Ain't no way your server won't break
      Unless you're sitting in a SONET node rack

      Are you crazy? Are you certified
      Your server is a molten heap
      Through the floor the slag still drips
      to the sound of the beep

      Chorus:
      Another one bytes the dust
      Another one bytes the dust
      And another one gone, and another one gone
      Another one bytes the dust
      Hey, I'm gonna slashdot you
      Another one bytes the dust

      How long till my router cacks
      after a weekend slashdot bitch smack
      I invested everything that I had
      even wrote a custom ip stack

      Are you crazy? Are you certified
      Your server is a molten heap
      Through the floor the slag still drips
      to the sound of the beep

      chorus

      There are plenty of ways you can hurt a host
      and bring it to its knees
      you can heat em
      you can drop em
      you can install bad ram
      and even try using Windows ME

      But you're batshit, yes out of your tree
      If you think your isp won't freak
      Through the floor your server melts
      To the sound of the beep

      chorus

  6. First thing that went through my mind by Oriumpor · · Score: 2, Informative

    I gotta see this... and low and behold it looks sllooooow but it came through.

    btw content below:
    The phpstack demo server

    Welcome to the phpstack demo server! phpstack is a small TCP/IP stack and web server written in PHP. It is a quick and dirty proof-of-concept hack and shouldn't be taken too seriously.

    The web pages and pictures on this page are served by the phpstack server. The server only allows very small HTML pages and pictures, but it is able to support an unlimited amount of simultaneous connections.

    Read more about the phpstack on its home page:

    http://www.sics.se/~adam/phpstack/

    You are visitor number 446 and your IP address is XX.XX.XX.XX.

  7. Due to the anticipation of the /. effect . . . by dgrgich · · Score: 5, Informative

    Here's a screenshot of the phpserver results. Pretty cool stuff.

  8. A man with way too much free time by HBI · · Score: 2, Funny

    Between that C-64 based multitasking, multiplatform operating system with tcp/ip and a web server in it, and this...

    Dude, you need beer and chicks.

    --
    HBI's Law: Frequency of calling others Nazis is directly correlated with the likelihood of the accuser being Communist.
  9. How..? by iantri · · Score: 2, Interesting
    Err.. I don't know anything about PHP so give me the benefit of the doubt.

    Is PHP able to be run standalone?

    I thought it was parsed by a webserver module when accessed?

    1. Re:How..? by ^Case^ · · Score: 3, Informative

      PHP has a CLI interpreter. You can run it just like you run perl or whatever.

    2. Re:How..? by Richard_at_work · · Score: 2, Informative

      There is now (since early 4.x versions) a command line version of PHP, for scripting purposes. All the benifits of mod_php in your scripts, and it is now installed by default along side the apache module. You can also acheive a similiar solution using the cgi binary.

  10. PSHTTPD - PostScript webserver by Richard_L_James · · Score: 4, Interesting

    This php webserver reminds me of HTTPi a webserver written in 100% perl. Neither of which are that hard when you know. However Anders "Pugo" Karlsson wrote a webserver called PS HTTPD in postscript. Now that I found very impressive :)

    1. Re:PSHTTPD - PostScript webserver by InfiniteZero · · Score: 5, Funny

      What would be REALLY impressive is a webserver written in HTML.

  11. Nanoweb anyone ? by lonedfx · · Score: 4, Informative

    http://nanoweb.si.kz/

    Nanoweb is an HTTP server written in PHP, designed to be small, secure, and extensible.

    It is distributed under the terms of the GNU General Public License.

    Nanoweb's main features are :

    - HTTP/1.1 compliance
    - Powerful and easy configuration
    - Modular architecture
    - FastCGI, CGI and Server side includes support
    - Name and port based virtual hosts
    - Access control lists
    - htpasswd, MySQL, PostgreSQL and LDAP authentication support
    - Themes for server generated content
    - Apache compatible log format, MySQL logging
    - Directory browsing
    - inetd support and SSL via external helpers
    - Denial of Service protection
    - Proxy Server extension
    - Filters and gzip support
    - RBL support (mail-abuse.org)
    - Extension Protocols (request methods) support
    - ... and a lot more

    lone, dfx.

    1. Re:Nanoweb anyone ? by Bender_ · · Score: 4, Informative

      Nanoweb is an HTTP server written in PHP, ..

      Yes, but not TCP/IP stack.

    2. Re:Nanoweb anyone ? by Tokerat · · Score: 4, Funny


      Yea, but does it support PHP? ;-)

      --
      CAn'T CompreHend SARcaSm?
  12. ... unlimited ... by AchilleTalon · · Score: 2, Insightful
    "... to support an unlimited number of simultaneous TCP ..."
    Hey! Wake up, we are on /. and anyone here knows there is nothing unlimited in the universe, but human stupidity.

    --
    Achille Talon
    Hop!
  13. Not crashed yet by Ohreally_factor · · Score: 2, Informative

    It's just really slow. I'm visitor 1853.

    --
    It's not offtopic, dumbass. It's orthogonal.
  14. Re:I don't get it, really I don't by madstork2000 · · Score: 5, Informative

    PHP does not depend on a webserver to run. It can be executed standalone just fine. I use it that way as a PERL replacement. No need for flame wars, I do still use PERL , the PHP stuff is for "backend" scripts on my webservers that share some common custom PHP libraries I have written as part of web applications, in so doing I eliminated the need to reimplement a lot of logic in PERL...Anyway that was off topic, the point is PHP does NOT need a webserver to run.

    MS2k

  15. Re:So much time... by Enrico+Pulatzo · · Score: 2, Insightful

    that's an easy one. Cancer doesn't come with documentation. One can flesh out an implementation of a spec, but figuring out the great unknown is quite a bit more difficult.

  16. cool! by Anonymous Coward · · Score: 2, Funny

    now we only have to port PHP to wristwatches and commodore 64s to get them on the net.

  17. Re:So much time... by applef00 · · Score: 2, Insightful

    Maybe his skills don't lie in research medicine, preemptive military strategy, and/or patent law. Heck, maybe not even in criminal investigation!

    Seriously, dude. This is Slashdot. While I agree that these (well, most of them) are worthwhile efforts, the simple fact is that most people on Slashdot are just looking for a little entertainment and escape from their day. We're geeks. We do geeky things.

    Get over it.

  18. Re:Hardly new.. by Bender_ · · Score: 4, Funny

    Yes, it is new. The difference is that it is not only a web server, but also an entire TCP/IP stack!

  19. Different window? by kendallemm · · Score: 5, Funny
    Just let it load in a different window while you read the rest of the headlines.

    This is slashdot. I think you meant "different tab" ;)

    KB
  20. Why? by Billy+the+Mountain · · Score: 3, Funny

    I think I might know why. Unless I'm missing the boat here, this would lead to making a more efficient web server. If the IP stack, the web server and the dynamic HTML processing is all integrated into one program, it seems to me that you'd have one very efficient html-processing screamer.

    BTM

    --
    That was the turning point of my life--I went from negative zero to positive zero.
  21. Re:A live demonstration server is up... by theguywhosaid · · Score: 2, Informative

    This guy is the greatest! its slow as crap, but its not down.

  22. Bzzt! Wrong! by Anonymous Coward · · Score: 3, Insightful

    All of those results are web related applications, e.g. application servers. None are web servers except for Reptile, which is written in Python!

  23. Should I know about this PHP? by Latent+Heat · · Score: 2, Interesting
    Strictly talking scripting languages, I have heard about Perl being good for text rearranging but being a little heavy on the non-letter characters, I have hacked out some VB script to do stuff under Windows, and I have experimented with Python. I have even heard about Ruby being popular among OO purists.

    Is this PHP thing something I should know about? I Googled for it and it seems more proprietary than Perl or Python (didn't find a free download and docs). I have read the criticism comments that PHP is in the Visual Basic category of encouraging weak minds to tackle strong tasks.

    Is this like Visual Basic in that it is cobbled together and lacks consistency and a uniform vision, or is it just simple to use and hence invites the scorn of the stronger minds? Is there some application domain where you really need to know this? Are there better substitutes? Does it have interesting ideas of its own worth emulating?

  24. I understand... by rsilvergun · · Score: 4, Funny

    this is what's taking Duke Nukem Forever so long. It's actually done, but it's all written entirely in PHP and they're waiting for the hardware to catch up.

    --
    Hi! I make Firefox Plug-ins. Check 'em out @ https://addons.mozilla.org/en-US/firefox/addon/youtube-mp3-podcaster/
  25. netcat anyone? by tiny69 · · Score: 2, Interesting
    $ telnet 193.10.67.151 80
    Trying 193.10.67.151...
    Connected to 193.10.67.151.
    Escape character is '^]'.

    HTTP/1.0 200 OK
    Content-type: text/html
    Server: phpstack 1.0 (http://www.sics.se/~adam/phpstack/)

    [html]
    [h ead][title]The phpstack demo server[/title][/head]
    [link rel="stylesheet" type="text/css" href="http://193.10.67.151:8080/style.css"]
    [body ]
    . . .
    . . .
    All I did was hit 'enter' after the connection was established without typing in the GET command. He could have saved some time and used netcat.
    --
    Go not unto/. for advice, for you will be told both yea and nay (but have nothing to do with the question)
  26. TCP/IP stack by duncanmacvicar · · Score: 2

    I don't understand why are you comparing it with other php Websevers. I think this guy is not using the php sockets functions, but his *own* tcp/ip stack, isn't he?

  27. Re:Hardly new.. by Penguin · · Score: 4, Informative

    Please, please, please read the the code (or at least the announcement) before replying. You are totally off the mark here. In short: It's easy to create a webserver in PHP (everybody did it so I did too: http://ter.dk:4281/ ), but we are talking about a TCP/IP-stack as well.

    And please, please, please don't mark any post "Informative", just because it is shorter than the original announcement.

    In response to a lot of other bewildered posts:

    • Yes, PHP is able to run standalone, and has "always" been so. Just compile the CGI executable. Furthermore, it is now split up in a CGI- and CLI-version. Hint: Using PHP from the command line
    • Yes, PHP is able to create TCP-connections and UDP-"connections" (in reality meaning just sending a package and retrieve a possible answer), and has been so for a long time (it was present yet unstable in PHP/FI, but worked fine from PHP3 - UDP-support was added later on). Hint: fsockopen()
    • Yes, PHP is able to listen to a port and has been so since PHP4.1.0. Hint: socket_create_listen()
    • Yes, PHP with process control enabled is able to fork and spawn childs, also since PHP4.1.0. Hint: pcntl_fork()

    Okay, get ready for the explanation of the announcement: PHP is just relying on the underneath TCP/IP-stack. Adams example includes the TCP/IP-stack itself (including ICMP). That's pretty neat.

    --
    - Peter Brodersen; professional nerd
  28. Not forgetting ... has Linux been ported to it yet by mikael · · Score: 2, Funny

    At this rate of development, it won't be long before somebody has the Linux kernel implemented in PHP.

    --
    Vintage computer adverts: http://www.vintageadbrowser.com/computers-and-software-ads
  29. Interesting by Pan+T.+Hose · · Score: 4, Funny

    Can this web server run PHP applications? If so, can it run the TCP/IP stack and a web server in-- Oh, God, my head!

    --
    Sincerely,
    Pan Tarhei Hosé, PhD.
    "Homo sum et cogito ergo odi profanum vulgus et libido."
  30. Re:I For One... by binaryspiral · · Score: 2, Funny

    This was the cry of many editorials back in the 50's and 60's when the U.S. went to the moon. But where would we be without Velcro or pens that can write upside down?!

  31. From the author by dunkels · · Score: 5, Informative

    I am the author of this and I must point out that the phpstack server is actually still running after over two hours of slashdotting! It is extremely slow, however, because of the insane amount of IP packets that have to traverse the 115200 bps serial line that connects the server with the rest of the world. The front page of the server currently reports that it has served 13157 visitors.

    A lot of people that comment here focus solely on the web server part of this software and completely miss the novel part in this: the TCP/IP stack. Writing a simple web server is dead easy. To the best of my knowledge, however, nobody has been stupid enough to write a TCP/IP stack in PHP before :-). The web server running on top of the stack is really simple and can be seen as the equivalent of the "netcat" web server someone suggested.

    The TCP/IP stack is intensionally extremely simplified (or "half-baked", if you wish) and tailored to the specific needs of the simple web server. Someone implied that the reason for the simplifications was that I maybe hadn't "figured out" how to handle fragmented packets. Well, it does not have to do with packet fragmentation (IP fragmentation is not that much of an issue today), but with the TCP receiver not trying to put together incoming TCP segments into a stream. Interested people could take a look at my uIP or lwIP TCP/IP stacks to see how to solve these problems in the general case. I have also written a paper that discuss issues with reducing TCP and IP in more detail.

    Of course, there are also the standard "this guy should get a life" comments. I always find it amusing to see such comments being posted only 10 minutes after the article hit the Slashdot front page, on a Saturday. I'm not the only one in need of a life, it seems :-)

    Finally, all of this is just a quick hack made solely for fun (and in part to learn more about PHP). I submitted it to Slashdot simply because I enjoy seeing articles like this myself. From the insane amount of traffic to my demo server, it seems that quite a lot of other people find it interesting as well :-)

  32. On the topic of pointless accomplishments... by fzammett · · Score: 4, Insightful

    About three years ago I wrote a very simplistic database server in Prolog on an Atari 800XL. This was of course AFTER I wrote a very simplistic Prolog compiler :) The database server accepted VERY basic SQL queries and could query against data on a floppy OR a cassette drive (yes, it supported cassettes!) and would display the results on the screen, nothing more (well, you could print it too, but I didn't have a printer, so I'm not 100% sure that would have worked).

    Why you ask? Well, I'm frankly not sure I would have ever thought of this "accomplishment" again had I not read many of the responses to the PHP thing...

    A friend of mine and I were having a little debate about how people sometimes do utterly pointless things with computers. We came to the conclusion that hackers in the generic "computer geek that likes to push the boundaries" sense of the word just like to see how far they can push things. They like to see what they can make these machines do that their designers never could have imagined them doing. This PHP thing is a good example of that, but applied to a language rather than hardware.

    Not every project has to have a real purpose behind it. Sometimes just seeing if you can pull something off, no matter how stupid it might seem, is well worth it.

    Oh yeah... my friend's "pointless" project? He wrote a web server on a Timex Sinclair 1000! He wired up an old C64 300 baud modem to the expansion port (so he couldn't use the 16k memory module at the same time), then dialed into his PC and used that as the network layer. IP requests to the web server were forwarded through the phone line, through the modem, and on to the Timex, which served up the pages. Everything was pre-loaded into memory from cassette when the server was started. To this day I don't know how he wrote the code to interface with the modem... I do know that he is an electrical engineering god and that he did have some external components added to the modem, but he told me, and I believe him, that the Timex was in fact controlling the modem. And you thought being limited to 1.5K per page with this PHP thing was crazy! Remember, the Timex had a GRAND TOTAL of 2K built-in! This to me is about as sick (and pointless!) as anything can get.

    Needless to say, his project was far and away more pointless than mine :) Both were fun as hell to do though, made us think in very unconventional ways, and forced us at the end to say "well, that's cool, but what the hell is the point?!?"

    The answer of course is "because we could, but we weren't so sure at the start". And that is many times the only answer you need.

    --
    If a pion (n-) collides with a proton in the woods & noone is there to hear it, does lamdba decay into the source pa
  33. Re:PHP and MySQL by kwenda · · Score: 2, Funny
    #!/usr/bin/php

    mysql_connect("host", "user", "pass");
    mysql_select_db("database");

    mysql_qu ery("UPDATE users SET owned=1 WHERE userId=79406");
  34. This is a joke, right? by l3ool · · Score: 2, Informative

    I really can't see any real world application of such a, umm, toy. Also, the claim that "the stack is able to support an unlimited number of simultaneous TCP connections" is, well, bogus.

    First off, regardless of how good a TCP/IP stack is you will still be limited by hardware. Then we have sockets, usually a 32 bit value on most platforms. Each client connection will use at least 1 of these sockets...and I'm guessing this "stack" uses PHP's socket functions; which wrap the real socket subsystem of the platform. So, that limits you to a maximun of 2^32 (~4294967296) available sockets; and 2^31 (~2147483648) on platforms that use a signed integer type to represent the socket. So, that little PHP toy stack will run outta sockets at some point.

    Dreams are nice though aren't they? Anyways, hope your ass doesn't get DOS'ed too bad there! =P