>#!/usr/local/bin/php -q ><? >// don't timeout! >set_time_limit(0); > >// set some variables >$host = "1.2.3.4..."; >$port = 1234; >$command = "/usr/games/fortune";
# I must be missing something, cuz I don't see where this $command is used... >// create socket >$socket = socket(AF_INET, SOCK_STREAM, 0) or die("Could not create >socket\n"); > >// bind socket to port >$result = bind($socket, $host, $port) or die("Could not bind to >socket\n"); > >/* start listening for connections >* My Script Fails here... > * Any suggestions why it fails the Socket SetUp... > * Should I screw around with the port numbers? > */ >$result = listen($socket, 3) or die("Set up Failed!"); >echo "Waiting for connections...\n"; You do realize that it's *SUPPOSED* to just sit there waiting for somebody to connect at this point, right?... It it saying "Set up Failed!"? I mean, it may *LOOK* like it "hangs" but it's really just "waiting..." You'll need to open another shell window and poke at the port it's listening to to get any action. Oh, and you probably need to use socket_listen, and not just "listen", I think... Or are these the old function names?... -- Like Music? http://l-i-e.com/artists.htm I'm looking for a PRO QUALITY two-input sound card supported by Linux (any major distro). Need to record live events (mixed already) to stereo CD-quality. Soundcard Recommendations? Software to handle the recording? Don't need fancy mixer stuff. Zero (0) post-production time. Just raw PCM/WAV/AIFF 16+ bit, 44.1KHz, Stereo audio-to-disk. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php