* Socket constructor * * @param string $host Remote hostname * @param int $port Remote port * @param resource $context Stream context * @param bool $persist Whether to use a persistent socket * @param string $debugHandler Function to call for error logging */
(
$host = 'localhost',
$port = 9090,
$context = null,
$debugHandler = null
)
| 50 | * @param string $debugHandler Function to call for error logging |
| 51 | */ |
| 52 | public function __construct( |
| 53 | $host = 'localhost', |
| 54 | $port = 9090, |
| 55 | $context = null, |
| 56 | $debugHandler = null |
| 57 | ) { |
| 58 | $this->host_ = $this->getSSLHost($host); |
| 59 | $this->port_ = $port; |
| 60 | // Initialize a stream context if not provided |
| 61 | if ($context === null) { |
| 62 | $context = stream_context_create(); |
| 63 | } |
| 64 | $this->context_ = $context; |
| 65 | $this->debugHandler_ = $debugHandler ? $debugHandler : 'error_log'; |
| 66 | } |
| 67 | |
| 68 | /** |
| 69 | * Creates a host name with SSL transport protocol |
nothing calls this directly
no test coverage detected