{-# LANGUAGE CPP #-}{-# LANGUAGE DeriveDataTypeable #-}#include "HsNetDef.h" moduleNetwork.Socket.Shutdown(ShutdownCmd (..),shutdown )whereimportNetwork.Socket.Imports importNetwork.Socket.Internal importNetwork.Socket.Types dataShutdownCmd =ShutdownReceive |ShutdownSend |ShutdownBoth derivingTypeablesdownCmdToInt::ShutdownCmd ->CIntsdownCmdToInt ShutdownReceive =0sdownCmdToIntShutdownSend =1sdownCmdToIntShutdownBoth =2-- | Shut down one or both halves of the connection, depending on the-- second argument to the function. If the second argument is-- 'ShutdownReceive', further receives are disallowed. If it is-- 'ShutdownSend', further sends are disallowed. If it is-- 'ShutdownBoth', further sends and receives are disallowed.shutdown::Socket ->ShutdownCmd ->IO()shutdown s stype =void$dofd <-fdSocket s throwSocketErrorIfMinus1Retry_ "Network.Socket.shutdown"$c_shutdown fd $sdownCmdToInt stype foreignimportCALLCONVunsafe"shutdown"c_shutdown::CInt->CInt->IOCInt