rfc:socket_getaddrinfo
Differences
This shows you the differences between two versions of the page.
rfc:socket_getaddrinfo [2016/08/24 17:11] bp1222 |
rfc:socket_getaddrinfo [2017/09/22 13:28] |
||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== PHP RFC: Implement socket_getaddrinfo() ====== | ||
- | * Version: 0.1 | ||
- | * Date: 2016-08-08 | ||
- | * Author: David Walker (dave@mudsite.com) | ||
- | * Status: Voting | ||
- | * First Published at: http:// | ||
- | ===== Introduction ===== | ||
- | This RFC targets a reported feature request in [[https:// | ||
- | |||
- | ===== Proposal ===== | ||
- | The implementation[[https:// | ||
- | <file php> | ||
- | socket_addrinfo_lookup(string node[, mixed service, array hints]) : array | ||
- | socket_addrinfo_connect(resource $addrinfo) : resource | ||
- | socket_addrinfo_bind(resource $addrinfo) : resource | ||
- | socket_addrinfo_explain(resource $addrinfo) : array | ||
- | </ | ||
- | |||
- | IPv4 Example | ||
- | <file php> | ||
- | <?php | ||
- | $addrinfo = socket_addrinfo_lookup(' | ||
- | $sockaddr = reset($addrinfo); | ||
- | if (!$sockaddr) die ("No Valid Socket Types" | ||
- | $sock = socket_addrinfo_bind($sockaddr); | ||
- | // ^^ $sock is a socket resource that is bound to 127.0.0.1: | ||
- | |||
- | var_dump(socket_addrinfo_explain($sockaddr)); | ||
- | /* Outputs: | ||
- | array(5) { | ||
- | [" | ||
- | int(0) | ||
- | [" | ||
- | int(2) | ||
- | [" | ||
- | int(1) | ||
- | [" | ||
- | int(6) | ||
- | [" | ||
- | array(2) { | ||
- | [" | ||
- | int(2000) | ||
- | [" | ||
- | string(9) " | ||
- | } | ||
- | } | ||
- | */ | ||
- | </ | ||
- | |||
- | IPv6 Example | ||
- | <file php> | ||
- | <?php | ||
- | $addrinfo = socket_addrinfo_lookup(' | ||
- | $sockaddr = reset($addrinfo); | ||
- | if (!$sockaddr) die ("No Valid Socket Types" | ||
- | $sock = socket_addrinfo_bind($sockaddr); | ||
- | // ^^ $sock is a socket resource that is bound to [::1]:2000 using TCP/IP ready for reading | ||
- | |||
- | var_dump(socket_addrinfo_explain($sockaddr)); | ||
- | /* Outputs: | ||
- | array(5) { | ||
- | [" | ||
- | int(0) | ||
- | [" | ||
- | int(10) | ||
- | [" | ||
- | int(1) | ||
- | [" | ||
- | int(6) | ||
- | [" | ||
- | array(2) { | ||
- | [" | ||
- | int(2000) | ||
- | [" | ||
- | string(3) ":: | ||
- | } | ||
- | } | ||
- | */ | ||
- | </ | ||
- | |||
- | ===== Backward Incompatible Changes ===== | ||
- | New functionality; | ||
- | |||
- | ===== Proposed PHP Version(s) ===== | ||
- | Next PHP 7.x (currently 7.2) | ||
- | |||
- | ===== RFC Impact ===== | ||
- | ==== To SAPIs ==== | ||
- | None | ||
- | |||
- | ==== To Existing Extensions ==== | ||
- | Socket acquired new functionality | ||
- | |||
- | ==== To Opcache ==== | ||
- | None | ||
- | |||
- | ==== New Constants ==== | ||
- | Exposing the AI_* family of constants. | ||
- | |||
- | ===== Proposed Voting Choices ===== | ||
- | Vote to implement the new functionality, | ||
- | <doodle title=" | ||
- | * Yes | ||
- | * No | ||
- | </ | ||
- | Vote Start: 2016-08-24 15:23 UTC | ||
- | |||
- | Vote End: | ||
- | |||
- | ===== References ===== | ||
- | * [1] - [[https:// |
rfc/socket_getaddrinfo.txt · Last modified: 2017/09/22 13:28 (external edit)