2009/5/27 HELP! <izoduwa@xxxxxxxxx>: > start> run> cmd> > telnet ip port > > could not connect In that case your problem is not with PHP. I suggest you talk to your network administrator. -Stuart -- http://stut.net/ > On Wed, May 27, 2009 at 1:44 PM, Stuart <stuttle@xxxxxxxxx> wrote: >> >> 2009/5/27 HELP! <izoduwa@xxxxxxxxx>: >> > I have made the correction but the error remiins: >> > >> > $port ="xx"; >> > $ip ="xx >> > $con ="tcp"; >> > $timeout = 30; >> > >> > >> > >> > >> > $fstream = stream_socket_client("$con://$ip:$port", $errno, $errstr, >> > $timeout); >> > >> > if($fstream){ >> > $str = stream_get_contents($fstream); >> > print( "Connection successful: $str "); >> > } >> > else{ >> > echo "Remote: ".$name."<br> str: $str<br>write:$br<br> $errstr >> > ($errno)"; >> > } >> >> My guess is that the IP you're trying to connect to is wrong. Can you >> telnet to that IP/port combination on a command line? >> >> -Stuart >> >> -- >> http://stut.net/ >> >> > On Wed, May 27, 2009 at 1:31 PM, Stuart <stuttle@xxxxxxxxx> wrote: >> >> >> >> 2009/5/27 HELP! <izoduwa@xxxxxxxxx>: >> >> > $port ="xx"; >> >> > $ip ="xx"; >> >> > $con =$transport = "tcp"; >> >> >> >> Which part of "See the manual for details" confused you? >> >> >> >> You're passing ... >> >> >> >> "$con:$ip:$port" >> >> >> >> ... which based on the above will translate to ... >> >> >> >> "tcp:xx:xx" >> >> >> >> ... which is invalid. It should be ... >> >> >> >> "$con://$ip:$port" >> >> >> >> ... which will translate to ... >> >> >> >> "tcp://xx:xx" >> >> >> >> ... which is a valid value. >> >> >> >> Please, read the damn manual ... carefully!! >> >> >> >> -Stuart >> >> >> >> -- >> >> http://stut.net/ >> >> >> >> > On Wed, May 27, 2009 at 1:24 PM, Stuart <stuttle@xxxxxxxxx> wrote: >> >> >> >> >> >> 2009/5/27 HELP! <izoduwa@xxxxxxxxx>: >> >> >> > Hi, >> >> >> > error: >> >> >> > php_network_getaddresses: getaddrinfo failed: No such host is >> >> >> > known >> >> >> > >> >> >> > $fstream = stream_socket_client("$con:$ip:$port", $errno, >> >> >> > $errstr, >> >> >> > $timeout); >> >> >> > >> >> >> > if($fstream){ >> >> >> > $br = fwrite($fstream,$login_request_block); >> >> >> > $str = stream_get_contents($fstream); >> >> >> > print( "Connection successful: $str "); >> >> >> > } >> >> >> > else{ >> >> >> > return " str: $str<br>write:$br<br> $errstr ($errno)"; >> >> >> > } >> >> >> > >> >> >> > What could be the error >> >> >> >> >> >> What's in $con? I'm guessing "tcp" in which case the first parameter >> >> >> to stream_socket_client is wrong. See the manual for details: >> >> >> http://php.net/stream_socket_client >> >> >> >> >> >> In future please consult the manual and double-check that you're >> >> >> passing valid arguments to the functions you're using before asking >> >> >> on >> >> >> this list. >> >> >> >> >> >> -Stuart >> >> >> >> >> >> -- >> >> >> http://stut.net/ >> >> > >> >> > >> >> > >> >> > -- >> >> > www.bemycandy.com >> >> > >> > >> > >> > >> > -- >> > www.bemycandy.com >> > > > > > -- > www.bemycandy.com > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php