|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2003-04-10 08:54 UTC] fcv at dev6 dot com
[2003-04-10 09:01 UTC] wez@php.net
[2003-04-21 09:22 UTC] sniper@php.net
[2003-04-21 10:32 UTC] fcv at dev6 dot com
[2003-04-21 10:41 UTC] fcv at dev6 dot com
[2003-04-21 14:50 UTC] pollita@php.net
[2003-04-28 11:16 UTC] sniper@php.net
|
|||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Mon Oct 27 19:00:02 2025 UTC |
Using fsockopen with the only 2 required parameters (hostname and port) like this fails: $myfilepointer = fsockopen($this->host, $this->port); And returns the following error: Warning: fsockopen() [function.fsockopen]: unable to connect to :23 in c:\programas\apache group\apache\htdocs\es-operadores\engine\telnet.php on line 97 The hostname is "10.1.2.9" (ip of my telnet server) The port is 23. $this is my telnet class initialized properly before use like this $telnet = new telnet($hostname, $port); function telnet($hostname, $port){ $this->host = $hostname; $this->port = $port; ... } and line 97 is $this->sock = fsockopen($this->$host, $this->port); This setup worked perfectly with PHP 4.2.x and stopped working when i upgraded to 4.3.1. Now, the script attempts to connect to host "23" which is obviously wrong. It assumes the second argument of fsockopen to be the host instead of port. If i insert a protocol argument before my host, it dumps data at an amazingly brutal rate to Internet Explorer causing it to hog my system memory and CPU (actualy, causes a memory leak in explorer. if i don't ctrl-alt-del and kill explorer, it uses up to 1GB of ram). Am i using the function properly? According to the online documentation, yes! One weird thing is that you mention the protocol argument is only mandatory if i use UDP and it is specified and a prefix of the hostname (protocol://hopstname) and not as a separate argument. But Dreamweaver MX autocomplete shows fsockopen(udp://, hostname, port, err1, err2, timeout). Thanks in advance!