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
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: email at davekok dot nl
New email:
PHP Version: OS:

 

 [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: Fri May 24 20:01:29 2019 UTC