Home » questions » how to shut down a socket connection between a client and a server?

how to shut down a socket connection between a client and a server?

2006-08-06 16:10:20, Category: Programming & Design
thanks.i am doing the project in c and i have to shutdown the server when the client sends "shutdown".

Answers

  1. Arkangyle

    On 2006-08-06 16:38:30


    We need to know what programming language and API you are using in order to answer this question. Please provide additional details if you want an answer. Well ... still didn't specify the API ... for the WinAPI, you'd use the function closesocket() ... int closesocket(SOCKET s) Returns a 0 on success, otherwise return value is as follows : WSANOTINITIALISED : A successful WSAStartup must occur before using this function. WSAENETDOWN : The Windows Sockets implementation has detected that the network subsystem has failed. WSAENOTSOCK : The descriptor is not a socket. WSAEINPROGRESS : A blocking Windows Sockets call is in progress. WSAEINTR : The (blocking) call was canceled using WSACancelBlockingCall. WSAEWOULDBLOCK : The socket is marked as nonblocking and SO_LINGER is set to a nonzero timeout value.