PHP
联网 | Networking

socket_shutdown

socket_shutdown

(PHP 4 >= 4.1.0, PHP 5, PHP 7)

socket_shutdown — Shuts down a socket for receiving, sending, or both

Description

bool socket_shutdown ( resource $socket [, int $how = 2 ] )

The socket_shutdown() function allows you to stop incoming, outgoing or all data (the default) from being sent through the socket

Note: The associated buffer, or buffers, may or may not be emptied.

Parameters

socket

A valid socket resource created with socket_create().

how

The value of how can be one of the following:

0Shutdown socket reading
1Shutdown socket writing
2Shutdown socket reading and writing

Return Values

Returns TRUE on success or FALSE on failure.

← socket_setopt

socket_strerror →

© 1997–2017 The PHP Documentation Group

Licensed under the Creative Commons Attribution License v3.0 or later.

https://secure.php.net/manual/en/function.socket-shutdown.php