Home |
Function shutdown |
Function shutdownDisable receives and/or sends on a socket. int shutdown(SOCKET socket, int how); ParameterssocketSocket returned by socket or accept. howSpecifies which operations to shutdown (0=disable writes; 1=disable sends; 2=disable both). return valueReturns 0 if successful, otherwise SOCKET_ERROR. If an error occurred, call xn_getlasterror and xn_geterror_string to return the error value. Section Error Codes further describes each error. Possible values for this function are:
Depending upon the value of the how parameter, this function disables or enables receives and/or sends on a socket. If how is 0, receives are disabled. If how is 1, sends are disabled. If how is 2, both receives and sends are disabled. For TCP, if receives are disabled, incoming data will be accepted until the input window is full, but the data will not be acknowledged. If sends are disabled, a FIN will be sent. For UDP and RAW, if receives are disabled, incoming packets are queued on the UDP exchange. The number of packets which may be queued is controlled by setsockopt with the SO_MAX_UDP_QUE option. Resources will not be freed until a closesocket or xn_abort (TCP only) is called.
|