use stream_set_timeout only with php 4.3.0 and above

This commit is contained in:
Lars Kneschke 2003-09-28 10:32:12 +00:00
parent 509aff2cda
commit 171addbc59

View File

@ -75,12 +75,12 @@
} }
break; break;
} }
if(floor(phpversion()) == 4) if(version_compare(phpversion(),'4.3.0') >= 0)
{ {
$this->socket = fsockopen($server,$port,$errcode,$errmsg,$timeout); $this->socket = fsockopen($server,$port,$errcode,$errmsg,$timeout);
if($this->socket) if($this->socket)
{ {
socket_set_timeout($this->socket,$timeout,0); stream_set_timeout($this->socket,$timeout,0);
} }
} }
else else