Aerys\Server::generateBindableAddressContextMap PHP Method

generateBindableAddressContextMap() private method

    private function generateBindableAddressContextMap()
    {
        $addrCtxMap = [];
        $addresses = $this->vhosts->getBindableAddresses();
        $tlsBindings = $this->vhosts->getTlsBindingsByAddress();
        $backlogSize = $this->options->socketBacklogSize;
        $shouldReusePort = !$this->options->debug;
        foreach ($addresses as $address) {
            $context = stream_context_create(["socket" => ["backlog" => $backlogSize, "so_reuseport" => $shouldReusePort, "ipv6_v6only" => true]]);
            if (isset($tlsBindings[$address])) {
                stream_context_set_option($context, ["ssl" => $tlsBindings[$address]]);
            }
            $addrCtxMap[$address] = $context;
        }
        return $addrCtxMap;
    }