setServerSocketContext ( array $context = [] ) : object

参数

@param    array   $context    socket上下文选项

说明

设置 socket 上下文选项

举栗

$context = array(
    'ssl' => array(
        'local_cert'                => '/paht/to/cert.crt', 
        'local_pk'                  => '/path/to/cert.key',
        'verify_peer'               => false,
        'allow_self_signed'         => true, 
    )   
);
$this->worker = new Producer();
$this->worker->setServerSocketContext($context);

results matching ""

    No results matching ""