php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #73406 Update new addrinfo API to allow setting socket options.
Submitted: 2016-10-28 06:14 UTC Modified: -
From: email at davekok dot nl Assigned:
Status: Open Package: Sockets related
PHP Version: master-Git-2016-10-28 (Git) OS:
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2016-10-28 06:14 UTC] email at davekok dot nl
Description:
------------
The new socket_getaddrinfo is a great new additions [https://wiki.php.net/rfc/socket_getaddrinfo]. However it does not allow making setting socket options before bind or connect are called. As the creations of the socket and calling bind/connect are done in a single function.

Especially for bind this is annoying as you often want to make the socket reusable.

  socket_set_option($this->socket, SOL_SOCKET, SO_REUSEADDR, 1)

Any change socket options could be passed into socket_addrinfo_{bind,connect} as a second parameter? Something like an array containing arrays with three arguments to describe the socket option, which must be set after the socket is created but before connect or bind are called.



Patches

Add a Patch

Pull Requests

Add a Pull Request

 
PHP Copyright © 2001-2019 The PHP Group
All rights reserved.
Last updated: Tue Jun 25 06:01:25 2019 UTC