WordPress at a glance
function is not described

Snoopy::_connect() public WP 1.0

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

No Hooks.

Return

null. Null. Nothing.

Usage

$Snoopy = new Snoopy();
$Snoopy->_connect( $fp );
$fp (required) (passed by reference — &)
-

Code of Snoopy::_connect() WP 5.7.1

<?php
function _connect(&$fp)
{
	if(!empty($this->proxy_host) && !empty($this->proxy_port))
		{
			$this->_isproxy = true;

			$host = $this->proxy_host;
			$port = $this->proxy_port;
		}
	else
	{
		$host = $this->host;
		$port = $this->port;
	}

	$this->status = 0;

	if($fp = fsockopen(
				$host,
				$port,
				$errno,
				$errstr,
				$this->_fp_timeout
				))
	{
		// socket connection succeeded

		return true;
	}
	else
	{
		// socket connection failed
		$this->status = $errno;
		switch($errno)
		{
			case -3:
				$this->error="socket creation failed (-3)";
			case -4:
				$this->error="dns lookup failure (-4)";
			case -5:
				$this->error="connection refused or timed out (-5)";
			default:
				$this->error="connection failed (".$errno.")";
		}
		return false;
	}
}