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
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
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: Sun Nov 24 12:01:33 2024 UTC