Museum

Home

Lab Overview

Retrotechnology Articles

⇒ Online Manual

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

connect(2)

socket(2)



  shutdown(2)                         CLIX                         shutdown(2)



  NAME

    shutdown - Shuts down part of a full-duplex connection

  LIBRARY

    Berkeley Software Distribution Library (libbsd.a)

  SYNOPSIS

    int shutdown(
      int s ,
      int how );

  PARAMETERS

    s     Represents a socket descriptor.

    how   Specifies how the socket should be shut down.

  DESCRIPTION

    The shutdown() function causes all or part of a full-duplex connection on
    the socket associated with descriptor s to be shut down.  If how is 0,
    further receives will be disallowed.  If how is 1, further sends will be
    disallowed.  If how is 2, further sends and receives will be disallowed.

  EXAMPLES

    To disallow further read and write attempts:

    if (shutdown(sd, 2) == -1)
         perror("Shutdown failed");


  RETURN VALUES

    Upon successful completion, a value of 0 is returned.  Otherwise, a value
    of -1 is returned and errno is set to indicate the error.

  ERRORS

    The shutdown() function fails if one or more of the following is true:

    [EBADF]      The descriptor is not valid.

    [ENOTSOCK]   The descriptor references a file, not a socket.

    [ENOTCONN]   The specified socket is not connected.

    [EINVAL]     The value for how is not 0, 1, or 2.



  2/94 - Intergraph Corporation                                              1






  shutdown(2)                         CLIX                         shutdown(2)



    [EINTR]      A signal was caught during the shutdown() function.

  RELATED INFORMATION

    Functions:  connect(2), socket(2)

















































  2                                              Intergraph Corporation - 2/94




Typewritten Software • bear@typewritten.org • Edmonds, WA 98026