Hi all.

 I am running PHP 4.1.0 on a win32 machine as a comand line
application.
I uncommented the line 'extension=php_sockets.dll' in my php.ini file
by removing the semi-colon but I receive the following error:

PHP Warning:  Unable to load dynamic library
'.;C:\php\extensions/php_sockets.dl
l' - One of the library files needed to run this application cannot be
found.


My source code is listed below:


Thanks,

-Katie.


<?php

// set some variables
$host = "192.168.1.99";
$port = 1234;

// don't timeout!
set_time_limit(0);

// create socket
$socket = socket_create(AF_INET, SOCK_STREAM, 0) or die("Could not
create
socket\n");

// bind socket to port
$result = socket_bind($socket, $host, $port) or die("Could not bind to
socket\n");

// start listening for connections
$result = socket_listen($socket, 3) or die("Could not set up socket
listener\n");

// accept incoming connections
// spawn another socket to handle communication
$spawn = socket_accept($socket) or die("Could not accept incoming
connection\n");

// read client input
$input = socket_read($spawn, 1024) or die("Could not read input\n");

// clean up input string
$input = trim($input);

// reverse client input and send back
$output = strrev($input) . "\n";
socket_write($spawn, $output, strlen ($output)) or die("Could not write
output\n");

// close sockets
socket_close($spawn);
socket_close($socket);
?>


=====


__________________________________________________
Do You Yahoo!?
Yahoo! Sports - Coverage of the 2002 Olympic Games
http://sports.yahoo.com

-- 
PHP Install Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to