PHP: stream_socket_shutdown - Manual

downloads | documentation | faq | getting help | mailing lists | reporting bugs | php.net sites | links | conferences | my php.net

search for in the

stream_wrapper_register stream_socket_server

Last updated: Sat, 27 Jan 2007

view this page in

# stream_socket_shutdown

(no version information, might be only in CVS)

stream_socket_shutdown -- Shutdown a full-duplex connection

## Описание

int stream_socket_shutdown ( resource stream, int how )

Shutdowns (partially or not) a full-duplex connection.

## Список параметров

`stream`

  An open stream (opened with stream_socket_client(), for example)

`how`

  One of the following constants: `STREAM_SHUT_RD` (disable further receptions), `STREAM_SHUT_WR` (disable further transmissions) or `STREAM_SHUT_RDWR` (disable further receptions and transmissions).

## Возвращаемые значения

Возвращает `TRUE` в случае успешного завершения или `FALSE` в случае возникновения ошибки.

## Примеры

Пример 1. A stream_socket_shutdown() example

`<?php
$server = stream_socket_server('tcp://127.0.0.1:1337');
$client = stream_socket_client('tcp://127.0.0.1:1337');
var_dump(fputs($client, "hello"));
stream_socket_shutdown($client, STREAM_SHUT_WR);
var_dump(fputs($client, "hello")); // doesn't work now
?>`

Результатом выполнения данного примера будет что-то подобное:

    int(5)

    Notice: fputs(): send of 5 bytes failed with errno=32 Broken pipe in test.php on line 9
    int(0)

## Смотрите также

fclose()

add a note User Contributed Notes
stream_socket_shutdown
There are no user contributed notes for this page.
stream_wrapper_register stream_socket_server

Last updated: Sat, 27 Jan 2007
show source | credits | stats | sitemap | contact | advertising | mirror sites
Copyright © 2001-2007 The PHP Group
All rights reserved.
This mirror generously provided by: Yahoo! Inc.
Last updated: Sat Mar 10 10:36:09 2007 PST