stream_socket_get_name

(PHP 5, PHP 7, PHP 8)

stream_socket_get_nameローカルまたはリモートのソケットの名前を取得する

説明

stream_socket_get_name(resource $handle, bool $want_peer): string

指定したソケット接続のローカルまたはリモートでの名前を返します。

パラメータ

handle

名前を取得したいソケット。

want_peer

true に設定するとリモートでのソケットの名前を返し、 false に設定するとローカルでのソケットの名前を返します。

返り値

ソケットの名前を返します。

参考

add a note add a note

User Contributed Notes 1 note

up
5
recycling dot sp dot am at gmail dot com
13 years ago
Surprisingly, on my Linux system, when connected to a localhost service using IPV4, stream_get_socket_name returns ::1 as the peer or local address. One would expect to get localhost or 127.0.0.1 but the ::1 IPV6 localhost is returned instead.
To Top