ftp_sockets::_connectpublicWP 1.0

Method of the class: ftp_sockets{}

No Hooks.

Returns

null. Nothing (null).

Usage

$ftp_sockets = new ftp_sockets();
$ftp_sockets->_connect( $host, $port );
$host(required)
.
$port(required)
.

ftp_sockets::_connect() code WP 7.1

function _connect($host, $port) {
	$this->SendMSG("Creating socket");
	if(!($sock = @socket_create(AF_INET, SOCK_STREAM, SOL_TCP))) {
		$this->PushError('_connect','socket create failed',socket_strerror(socket_last_error($sock)));
		return FALSE;
	}
	if(!$this->_settimeout($sock)) return FALSE;
	$this->SendMSG("Connecting to \"".$host.":".$port."\"");
	if (!($res = @socket_connect($sock, $host, $port))) {
		$this->PushError('_connect','socket connect failed',socket_strerror(socket_last_error($sock)));
		@socket_close($sock);
		return FALSE;
	}
	$this->_connected=true;
	return $sock;
}