WordPress at Your Fingertips
function is not described

ftp_sockets::_settimeout() public WP 1.0

<!-- --------------------------------------------------------------------------------------- --> <!-- Private functions --> <!-- --------------------------------------------------------------------------------------- -->

{} It's a method of the class: ftp_sockets{}

No Hooks.

Return

null. Nothing.

Usage

$ftp_sockets = new ftp_sockets();
$ftp_sockets->_settimeout( $sock );
$sock (required)
-

Code of ftp_sockets::_settimeout() WP 5.8.2

function _settimeout($sock) {
	if(!@socket_set_option($sock, SOL_SOCKET, SO_RCVTIMEO, array("sec"=>$this->_timeout, "usec"=>0))) {
		$this->PushError('_connect','socket set receive timeout',socket_strerror(socket_last_error($sock)));
		@socket_close($sock);
		return FALSE;
	}
	if(!@socket_set_option($sock, SOL_SOCKET , SO_SNDTIMEO, array("sec"=>$this->_timeout, "usec"=>0))) {
		$this->PushError('_connect','socket set send timeout',socket_strerror(socket_last_error($sock)));
		@socket_close($sock);
		return FALSE;
	}
	return true;
}