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 Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
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

Pull Requests

 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Nov 21 15:01:30 2024 UTC