Chapter Contents

Previous

Next
shutdown

shutdown



Ends Communication with a Socket

Portability: UNIX compatible


SYNOPSIS
DESCRIPTION
RETURN VALUE
PORTABILITY
RELATED FUNCTIONS


SYNOPSIS

#include <sys/types.h>
#include <sys/socket.h>

int shutdown(int s, int how);


DESCRIPTION

shutdown ends communication on socket descriptor s in one or both directions. how specifies the shutdown condition and can be specified in the following ways:

0
does not allow any more receives.

1
does not allow any more sends.

2
does not allow any more sends or receives.


RETURN VALUE

If shutdown is successful, it returns a 0 ; otherwise, it returns a -1 , and sets errno to indicate the type of error.


PORTABILITY

shutdown is portable to other environments, including most UNIX systems, that implement BSD sockets.


RELATED FUNCTIONS

close


Chapter Contents

Previous

Next

Top of Page

Copyright © 2001 by SAS Institute Inc., Cary, NC, USA. All rights reserved.