kern_soshutdown Kernel Service

Purpose

Closes the read-half, write-half or both read and write of a connection.

Syntax

#include <sys/kern_socket.h>
int  kern_soshutdown( ksocket_t  so, int how )

Parameters

Item Description
so The socket to which the shutdown will be issued.
how 0 read, 1 write, 2 read and write

Description

The kern_soshutdown kernel service closes the read-half, write-half or both read and write of a connection.

Execution Environment

The kern_soshutdown kernel service can be called from the process environment.

Examples

ksocket_t    so;

/* Create the socket so */

kern_socreate(AF_INET, &so, SOCK_STREAM, IPPROTO_TCP);

/* Shutting down both the read/write */ 

kern_soshutdown(so, 2);

Return Values

Item Description
0 Upon Success
>0 Error