    {-# LANGUAGE TypeApplications #-}

    -- | Copyright  : Will Thompson, Iñaki García Etxebarria and Jonas Platte
    -- License    : LGPL-2.1
    -- Maintainer : Iñaki García Etxebarria
    --
    -- This is the subclass of t'GI.Gio.Objects.SocketConnection.SocketConnection' that is created
    -- for TCP\/IP sockets.
    --
    -- /Since: 2.22/

    #if !defined(__HADDOCK_VERSION__)
    #define ENABLE_OVERLOADING
    #endif

    module GI.Gio.Objects.TcpConnection
        (

    -- * Exported types
        TcpConnection(..)                       ,
        IsTcpConnection                         ,
        toTcpConnection                         ,

     -- * Methods
    -- ** Overloaded methods #method:Overloaded methods#

    #if defined(ENABLE_OVERLOADING)
        ResolveTcpConnectionMethod              ,
    #endif

    -- ** getGracefulDisconnect #method:getGracefulDisconnect#

    #if defined(ENABLE_OVERLOADING)
        TcpConnectionGetGracefulDisconnectMethodInfo,
    #endif
        tcpConnectionGetGracefulDisconnect      ,

    -- ** setGracefulDisconnect #method:setGracefulDisconnect#

    #if defined(ENABLE_OVERLOADING)
        TcpConnectionSetGracefulDisconnectMethodInfo,
    #endif
        tcpConnectionSetGracefulDisconnect      ,

     -- * Properties
    -- ** gracefulDisconnect #attr:gracefulDisconnect#
    -- | /No description available in the introspection data./

    #if defined(ENABLE_OVERLOADING)
        TcpConnectionGracefulDisconnectPropertyInfo,
    #endif
        constructTcpConnectionGracefulDisconnect,
        getTcpConnectionGracefulDisconnect      ,
        setTcpConnectionGracefulDisconnect      ,
    #if defined(ENABLE_OVERLOADING)
        tcpConnectionGracefulDisconnect         ,
    #endif

        ) where

    import Data.GI.Base.ShortPrelude
    import qualified Data.GI.Base.ShortPrelude as SP
    import qualified Data.GI.Base.Overloading as O
    import qualified Prelude as P

    import qualified Data.GI.Base.Attributes as GI.Attributes
    import qualified Data.GI.Base.BasicTypes as B.Types
    import qualified Data.GI.Base.ManagedPtr as B.ManagedPtr
    import qualified Data.GI.Base.GArray as B.GArray
    import qualified Data.GI.Base.GClosure as B.GClosure
    import qualified Data.GI.Base.GError as B.GError
    import qualified Data.GI.Base.GVariant as B.GVariant
    import qualified Data.GI.Base.GValue as B.GValue
    import qualified Data.GI.Base.GParamSpec as B.GParamSpec
    import qualified Data.GI.Base.CallStack as B.CallStack
    import qualified Data.GI.Base.Properties as B.Properties
    import qualified Data.GI.Base.Signals as B.Signals
    import qualified Control.Monad.IO.Class as MIO
    import qualified Data.Text as T
    import qualified Data.ByteString.Char8 as B
    import qualified Data.Map as Map
    import qualified Foreign.Ptr as FP
    import qualified GHC.OverloadedLabels as OL

    import qualified GI.GObject.Objects.Object as GObject.Object
    import {-# SOURCE #-} qualified GI.Gio.Objects.IOStream as Gio.IOStream
    import {-# SOURCE #-} qualified GI.Gio.Objects.SocketConnection as Gio.SocketConnection

    -- | Memory-managed wrapper type.
    newtype TcpConnection = TcpConnection (SP.ManagedPtr TcpConnection)
        deriving (TcpConnection -> TcpConnection -> Bool
    (TcpConnection -> TcpConnection -> Bool)
    -> (TcpConnection -> TcpConnection -> Bool) -> Eq TcpConnection
    forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
    /= :: TcpConnection -> TcpConnection -> Bool
    $c/= :: TcpConnection -> TcpConnection -> Bool
    == :: TcpConnection -> TcpConnection -> Bool
    $c== :: TcpConnection -> TcpConnection -> Bool
    Eq)

    instance SP.ManagedPtrNewtype TcpConnection where
        toManagedPtr :: TcpConnection -> ManagedPtr TcpConnection
    toManagedPtr (TcpConnection p :: ManagedPtr TcpConnection
    p) = ManagedPtr TcpConnection
    p

    foreign import ccall "g_tcp_connection_get_type"
        c_g_tcp_connection_get_type :: IO B.Types.GType

    instance B.Types.TypedObject TcpConnection where
        glibType :: IO GType
    glibType = IO GType
    c_g_tcp_connection_get_type

    instance B.Types.GObject TcpConnection

    -- | Convert 'TcpConnection' to and from 'Data.GI.Base.GValue.GValue' with 'Data.GI.Base.GValue.toGValue' and 'Data.GI.Base.GValue.fromGValue'.
    instance B.GValue.IsGValue TcpConnection where
        toGValue :: TcpConnection -> IO GValue
    toGValue o :: TcpConnection
    o = do
            GType
    gtype <- IO GType
    c_g_tcp_connection_get_type
            TcpConnection -> (Ptr TcpConnection -> IO GValue) -> IO GValue
    forall a c.
    (HasCallStack, ManagedPtrNewtype a) =>
    a -> (Ptr a -> IO c) -> IO c
    B.ManagedPtr.withManagedPtr TcpConnection
    o (GType
    -> (GValue -> Ptr TcpConnection -> IO ())
    -> Ptr TcpConnection
    -> IO GValue
    forall a. GType -> (GValue -> a -> IO ()) -> a -> IO GValue
    B.GValue.buildGValue GType
    gtype GValue -> Ptr TcpConnection -> IO ()
    forall a. GObject a => GValue -> Ptr a -> IO ()
    B.GValue.set_object)

        fromGValue :: GValue -> IO TcpConnection
    fromGValue gv :: GValue
    gv = do
            Ptr TcpConnection
    ptr <- GValue -> IO (Ptr TcpConnection)
    forall b. GObject b => GValue -> IO (Ptr b)
    B.GValue.get_object GValue
    gv :: IO (Ptr TcpConnection)
            (ManagedPtr TcpConnection -> TcpConnection)
    -> Ptr TcpConnection -> IO TcpConnection
    forall a b.
    (HasCallStack, GObject a, GObject b) =>
    (ManagedPtr a -> a) -> Ptr b -> IO a
    B.ManagedPtr.newObject ManagedPtr TcpConnection -> TcpConnection
    TcpConnection Ptr TcpConnection
    ptr

    -- | Type class for types which can be safely cast to `TcpConnection`, for instance with `toTcpConnection`.
    class (SP.GObject o, O.IsDescendantOf TcpConnection o) => IsTcpConnection o
    instance (SP.GObject o, O.IsDescendantOf TcpConnection o) => IsTcpConnection o

    instance O.HasParentTypes TcpConnection
    type instance O.ParentTypes TcpConnection = '[Gio.SocketConnection.SocketConnection, Gio.IOStream.IOStream, GObject.Object.Object]

    -- | Cast to `TcpConnection`, for types for which this is known to be safe. For general casts, use `Data.GI.Base.ManagedPtr.castTo`.
    toTcpConnection :: (MonadIO m, IsTcpConnection o) => o -> m TcpConnection
    toTcpConnection :: o -> m TcpConnection
    toTcpConnection = IO TcpConnection -> m TcpConnection
    forall (m :: * -> *) a. MonadIO m => IO a -> m a
    liftIO (IO TcpConnection -> m TcpConnection)
    -> (o -> IO TcpConnection) -> o -> m TcpConnection
    forall b c a. (b -> c) -> (a -> b) -> a -> c
    . (ManagedPtr TcpConnection -> TcpConnection)
    -> o -> IO TcpConnection
    forall o o'.
    (HasCallStack, ManagedPtrNewtype o, TypedObject o,
     ManagedPtrNewtype o', TypedObject o') =>
    (ManagedPtr o' -> o') -> o -> IO o'
    unsafeCastTo ManagedPtr TcpConnection -> TcpConnection
    TcpConnection

    #if defined(ENABLE_OVERLOADING)
    type family ResolveTcpConnectionMethod (t :: Symbol) (o :: *) :: * where
        ResolveTcpConnectionMethod "bindProperty" o = GObject.Object.ObjectBindPropertyMethodInfo
        ResolveTcpConnectionMethod "bindPropertyFull" o = GObject.Object.ObjectBindPropertyFullMethodInfo
        ResolveTcpConnectionMethod "clearPending" o = Gio.IOStream.IOStreamClearPendingMethodInfo
        ResolveTcpConnectionMethod "close" o = Gio.IOStream.IOStreamCloseMethodInfo
        ResolveTcpConnectionMethod "closeAsync" o = Gio.IOStream.IOStreamCloseAsyncMethodInfo
        ResolveTcpConnectionMethod "closeFinish" o = Gio.IOStream.IOStreamCloseFinishMethodInfo
        ResolveTcpConnectionMethod "connect" o = Gio.SocketConnection.SocketConnectionConnectMethodInfo
        ResolveTcpConnectionMethod "connectAsync" o = Gio.SocketConnection.SocketConnectionConnectAsyncMethodInfo
        ResolveTcpConnectionMethod "connectFinish" o = Gio.SocketConnection.SocketConnectionConnectFinishMethodInfo
        ResolveTcpConnectionMethod "forceFloating" o = GObject.Object.ObjectForceFloatingMethodInfo
        ResolveTcpConnectionMethod "freezeNotify" o = GObject.Object.ObjectFreezeNotifyMethodInfo
        ResolveTcpConnectionMethod "getv" o = GObject.Object.ObjectGetvMethodInfo
        ResolveTcpConnectionMethod "hasPending" o = Gio.IOStream.IOStreamHasPendingMethodInfo
        ResolveTcpConnectionMethod "isClosed" o = Gio.IOStream.IOStreamIsClosedMethodInfo
        ResolveTcpConnectionMethod "isConnected" o = Gio.SocketConnection.SocketConnectionIsConnectedMethodInfo
        ResolveTcpConnectionMethod "isFloating" o = GObject.Object.ObjectIsFloatingMethodInfo
        ResolveTcpConnectionMethod "notify" o = GObject.Object.ObjectNotifyMethodInfo
        ResolveTcpConnectionMethod "notifyByPspec" o = GObject.Object.ObjectNotifyByPspecMethodInfo
        ResolveTcpConnectionMethod "ref" o = GObject.Object.ObjectRefMethodInfo
        ResolveTcpConnectionMethod "refSink" o = GObject.Object.ObjectRefSinkMethodInfo
        ResolveTcpConnectionMethod "runDispose" o = GObject.Object.ObjectRunDisposeMethodInfo
        ResolveTcpConnectionMethod "spliceAsync" o = Gio.IOStream.IOStreamSpliceAsyncMethodInfo
        ResolveTcpConnectionMethod "stealData" o = GObject.Object.ObjectStealDataMethodInfo
        ResolveTcpConnectionMethod "stealQdata" o = GObject.Object.ObjectStealQdataMethodInfo
        ResolveTcpConnectionMethod "thawNotify" o = GObject.Object.ObjectThawNotifyMethodInfo
        ResolveTcpConnectionMethod "unref" o = GObject.Object.ObjectUnrefMethodInfo
        ResolveTcpConnectionMethod "watchClosure" o = GObject.Object.ObjectWatchClosureMethodInfo
        ResolveTcpConnectionMethod "getData" o = GObject.Object.ObjectGetDataMethodInfo
        ResolveTcpConnectionMethod "getGracefulDisconnect" o = TcpConnectionGetGracefulDisconnectMethodInfo
        ResolveTcpConnectionMethod "getInputStream" o = Gio.IOStream.IOStreamGetInputStreamMethodInfo
        ResolveTcpConnectionMethod "getLocalAddress" o = Gio.SocketConnection.SocketConnectionGetLocalAddressMethodInfo
        ResolveTcpConnectionMethod "getOutputStream" o = Gio.IOStream.IOStreamGetOutputStreamMethodInfo
        ResolveTcpConnectionMethod "getProperty" o = GObject.Object.ObjectGetPropertyMethodInfo
        ResolveTcpConnectionMethod "getQdata" o = GObject.Object.ObjectGetQdataMethodInfo
        ResolveTcpConnectionMethod "getRemoteAddress" o = Gio.SocketConnection.SocketConnectionGetRemoteAddressMethodInfo
        ResolveTcpConnectionMethod "getSocket" o = Gio.SocketConnection.SocketConnectionGetSocketMethodInfo
        ResolveTcpConnectionMethod "setData" o = GObject.Object.ObjectSetDataMethodInfo
        ResolveTcpConnectionMethod "setDataFull" o = GObject.Object.ObjectSetDataFullMethodInfo
        ResolveTcpConnectionMethod "setGracefulDisconnect" o = TcpConnectionSetGracefulDisconnectMethodInfo
        ResolveTcpConnectionMethod "setPending" o = Gio.IOStream.IOStreamSetPendingMethodInfo
        ResolveTcpConnectionMethod "setProperty" o = GObject.Object.ObjectSetPropertyMethodInfo
        ResolveTcpConnectionMethod l o = O.MethodResolutionFailed l o

    instance (info ~ ResolveTcpConnectionMethod t TcpConnection, O.MethodInfo info TcpConnection p) => OL.IsLabel t (TcpConnection -> p) where
    #if MIN_VERSION_base(4,10,0)
        fromLabel = O.overloadedMethod @info
    #else
        fromLabel _ = O.overloadedMethod @info
    #endif

    #endif

    -- VVV Prop "graceful-disconnect"
       -- Type: TBasicType TBoolean
       -- Flags: [PropertyReadable,PropertyWritable]
       -- Nullable: (Just False,Just False)

    -- | Get the value of the “@graceful-disconnect@” property.
    -- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
    --
    -- @
    -- 'Data.GI.Base.Attributes.get' tcpConnection #gracefulDisconnect
    -- @
    getTcpConnectionGracefulDisconnect :: (MonadIO m, IsTcpConnection o) => o -> m Bool
    getTcpConnectionGracefulDisconnect :: o -> m Bool
    getTcpConnectionGracefulDisconnect obj :: o
    obj = IO Bool -> m Bool
    forall (m :: * -> *) a. MonadIO m => IO a -> m a
    liftIO (IO Bool -> m Bool) -> IO Bool -> m Bool
    forall a b. (a -> b) -> a -> b
    $ o -> String -> IO Bool
    forall a. GObject a => a -> String -> IO Bool
    B.Properties.getObjectPropertyBool o
    obj "graceful-disconnect"

    -- | Set the value of the “@graceful-disconnect@” property.
    -- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
    --
    -- @
    -- 'Data.GI.Base.Attributes.set' tcpConnection [ #gracefulDisconnect 'Data.GI.Base.Attributes.:=' value ]
    -- @
    setTcpConnectionGracefulDisconnect :: (MonadIO m, IsTcpConnection o) => o -> Bool -> m ()
    setTcpConnectionGracefulDisconnect :: o -> Bool -> m ()
    setTcpConnectionGracefulDisconnect obj :: o
    obj val :: Bool
    val = IO () -> m ()
    forall (m :: * -> *) a. MonadIO m => IO a -> m a
    liftIO (IO () -> m ()) -> IO () -> m ()
    forall a b. (a -> b) -> a -> b
    $ o -> String -> Bool -> IO ()
    forall a. GObject a => a -> String -> Bool -> IO ()
    B.Properties.setObjectPropertyBool o
    obj "graceful-disconnect" Bool
    val

    -- | Construct a `GValueConstruct` with valid value for the “@graceful-disconnect@” property. This is rarely needed directly, but it is used by `Data.GI.Base.Constructible.new`.
    constructTcpConnectionGracefulDisconnect :: (IsTcpConnection o, MIO.MonadIO m) => Bool -> m (GValueConstruct o)
    constructTcpConnectionGracefulDisconnect :: Bool -> m (GValueConstruct o)
    constructTcpConnectionGracefulDisconnect val :: Bool
    val = IO (GValueConstruct o) -> m (GValueConstruct o)
    forall (m :: * -> *) a. MonadIO m => IO a -> m a
    MIO.liftIO (IO (GValueConstruct o) -> m (GValueConstruct o))
    -> IO (GValueConstruct o) -> m (GValueConstruct o)
    forall a b. (a -> b) -> a -> b
    $ String -> Bool -> IO (GValueConstruct o)
    forall o. String -> Bool -> IO (GValueConstruct o)
    B.Properties.constructObjectPropertyBool "graceful-disconnect" Bool
    val

    #if defined(ENABLE_OVERLOADING)
    data TcpConnectionGracefulDisconnectPropertyInfo
    instance AttrInfo TcpConnectionGracefulDisconnectPropertyInfo where
        type AttrAllowedOps TcpConnectionGracefulDisconnectPropertyInfo = '[ 'AttrSet, 'AttrConstruct, 'AttrGet]
        type AttrBaseTypeConstraint TcpConnectionGracefulDisconnectPropertyInfo = IsTcpConnection
        type AttrSetTypeConstraint TcpConnectionGracefulDisconnectPropertyInfo = (~) Bool
        type AttrTransferTypeConstraint TcpConnectionGracefulDisconnectPropertyInfo = (~) Bool
        type AttrTransferType TcpConnectionGracefulDisconnectPropertyInfo = Bool
        type AttrGetType TcpConnectionGracefulDisconnectPropertyInfo = Bool
        type AttrLabel TcpConnectionGracefulDisconnectPropertyInfo = "graceful-disconnect"
        type AttrOrigin TcpConnectionGracefulDisconnectPropertyInfo = TcpConnection
        attrGet = getTcpConnectionGracefulDisconnect
        attrSet = setTcpConnectionGracefulDisconnect
        attrTransfer _ v = do
            return v
        attrConstruct = constructTcpConnectionGracefulDisconnect
        attrClear = undefined
    #endif

    #if defined(ENABLE_OVERLOADING)
    instance O.HasAttributeList TcpConnection
    type instance O.AttributeList TcpConnection = TcpConnectionAttributeList
    type TcpConnectionAttributeList = ('[ '("closed", Gio.IOStream.IOStreamClosedPropertyInfo), '("gracefulDisconnect", TcpConnectionGracefulDisconnectPropertyInfo), '("inputStream", Gio.IOStream.IOStreamInputStreamPropertyInfo), '("outputStream", Gio.IOStream.IOStreamOutputStreamPropertyInfo), '("socket", Gio.SocketConnection.SocketConnectionSocketPropertyInfo)] :: [(Symbol, *)])
    #endif

    #if defined(ENABLE_OVERLOADING)
    tcpConnectionGracefulDisconnect :: AttrLabelProxy "gracefulDisconnect"
    tcpConnectionGracefulDisconnect = AttrLabelProxy

    #endif

    #if defined(ENABLE_OVERLOADING)
    type instance O.SignalList TcpConnection = TcpConnectionSignalList
    type TcpConnectionSignalList = ('[ '("notify", GObject.Object.ObjectNotifySignalInfo)] :: [(Symbol, *)])

    #endif

    -- method TcpConnection::get_graceful_disconnect
    -- method type : OrdinaryMethod
    -- Args: [ Arg
    --           { argCName = "connection"
    --           , argType =
    --               TInterface Name { namespace = "Gio" , name = "TcpConnection" }
    --           , direction = DirectionIn
    --           , mayBeNull = False
    --           , argDoc =
    --               Documentation
    --                 { rawDocText = Just "a #GTcpConnection" , sinceVersion = Nothing }
    --           , argScope = ScopeTypeInvalid
    --           , argClosure = -1
    --           , argDestroy = -1
    --           , argCallerAllocates = False
    --           , transfer = TransferNothing
    --           }
    --       ]
    -- Lengths: []
    -- returnType: Just (TBasicType TBoolean)
    -- throws : False
    -- Skip return : False

    foreign import ccall "g_tcp_connection_get_graceful_disconnect" g_tcp_connection_get_graceful_disconnect ::
        Ptr TcpConnection ->                    -- connection : TInterface (Name {namespace = "Gio", name = "TcpConnection"})
        IO CInt

    -- | Checks if graceful disconnects are used. See
    -- 'GI.Gio.Objects.TcpConnection.tcpConnectionSetGracefulDisconnect'.
    --
    -- /Since: 2.22/
    tcpConnectionGetGracefulDisconnect ::
        (B.CallStack.HasCallStack, MonadIO m, IsTcpConnection a) =>
        a
        -- ^ /@connection@/: a t'GI.Gio.Objects.TcpConnection.TcpConnection'
        -> m Bool
        -- ^ __Returns:__ 'P.True' if graceful disconnect is used on close, 'P.False' otherwise
    tcpConnectionGetGracefulDisconnect :: a -> m Bool
    tcpConnectionGetGracefulDisconnect connection :: a
    connection = IO Bool -> m Bool
    forall (m :: * -> *) a. MonadIO m => IO a -> m a
    liftIO (IO Bool -> m Bool) -> IO Bool -> m Bool
    forall a b. (a -> b) -> a -> b
    $ do
        Ptr TcpConnection
    connection' <- a -> IO (Ptr TcpConnection)
    forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
    unsafeManagedPtrCastPtr a
    connection
        CInt
    result <- Ptr TcpConnection -> IO CInt
    g_tcp_connection_get_graceful_disconnect Ptr TcpConnection
    connection'
        let result' :: Bool
    result' = (CInt -> CInt -> Bool
    forall a. Eq a => a -> a -> Bool
    /= 0) CInt
    result
        a -> IO ()
    forall a. ManagedPtrNewtype a => a -> IO ()
    touchManagedPtr a
    connection
        Bool -> IO Bool
    forall (m :: * -> *) a. Monad m => a -> m a
    return Bool
    result'

    #if defined(ENABLE_OVERLOADING)
    data TcpConnectionGetGracefulDisconnectMethodInfo
    instance (signature ~ (m Bool), MonadIO m, IsTcpConnection a) => O.MethodInfo TcpConnectionGetGracefulDisconnectMethodInfo a signature where
        overloadedMethod = tcpConnectionGetGracefulDisconnect

    #endif

    -- method TcpConnection::set_graceful_disconnect
    -- method type : OrdinaryMethod
    -- Args: [ Arg
    --           { argCName = "connection"
    --           , argType =
    --               TInterface Name { namespace = "Gio" , name = "TcpConnection" }
    --           , direction = DirectionIn
    --           , mayBeNull = False
    --           , argDoc =
    --               Documentation
    --                 { rawDocText = Just "a #GTcpConnection" , sinceVersion = Nothing }
    --           , argScope = ScopeTypeInvalid
    --           , argClosure = -1
    --           , argDestroy = -1
    --           , argCallerAllocates = False
    --           , transfer = TransferNothing
    --           }
    --       , Arg
    --           { argCName = "graceful_disconnect"
    --           , argType = TBasicType TBoolean
    --           , direction = DirectionIn
    --           , mayBeNull = False
    --           , argDoc =
    --               Documentation
    --                 { rawDocText = Just "Whether to do graceful disconnects or not"
    --                 , sinceVersion = Nothing
    --                 }
    --           , argScope = ScopeTypeInvalid
    --           , argClosure = -1
    --           , argDestroy = -1
    --           , argCallerAllocates = False
    --           , transfer = TransferNothing
    --           }
    --       ]
    -- Lengths: []
    -- returnType: Nothing
    -- throws : False
    -- Skip return : False

    foreign import ccall "g_tcp_connection_set_graceful_disconnect" g_tcp_connection_set_graceful_disconnect ::
        Ptr TcpConnection ->                    -- connection : TInterface (Name {namespace = "Gio", name = "TcpConnection"})
        CInt ->                                 -- graceful_disconnect : TBasicType TBoolean
        IO ()

    -- | This enables graceful disconnects on close. A graceful disconnect
    -- means that we signal the receiving end that the connection is terminated
    -- and wait for it to close the connection before closing the connection.
    --
    -- A graceful disconnect means that we can be sure that we successfully sent
    -- all the outstanding data to the other end, or get an error reported.
    -- However, it also means we have to wait for all the data to reach the
    -- other side and for it to acknowledge this by closing the socket, which may
    -- take a while. For this reason it is disabled by default.
    --
    -- /Since: 2.22/
    tcpConnectionSetGracefulDisconnect ::
        (B.CallStack.HasCallStack, MonadIO m, IsTcpConnection a) =>
        a
        -- ^ /@connection@/: a t'GI.Gio.Objects.TcpConnection.TcpConnection'
        -> Bool
        -- ^ /@gracefulDisconnect@/: Whether to do graceful disconnects or not
        -> m ()
    tcpConnectionSetGracefulDisconnect :: a -> Bool -> m ()
    tcpConnectionSetGracefulDisconnect connection :: a
    connection gracefulDisconnect :: Bool
    gracefulDisconnect = IO () -> m ()
    forall (m :: * -> *) a. MonadIO m => IO a -> m a
    liftIO (IO () -> m ()) -> IO () -> m ()
    forall a b. (a -> b) -> a -> b
    $ do
        Ptr TcpConnection
    connection' <- a -> IO (Ptr TcpConnection)
    forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
    unsafeManagedPtrCastPtr a
    connection
        let gracefulDisconnect' :: CInt
    gracefulDisconnect' = (Int -> CInt
    forall a b. (Integral a, Num b) => a -> b
    fromIntegral (Int -> CInt) -> (Bool -> Int) -> Bool -> CInt
    forall b c a. (b -> c) -> (a -> b) -> a -> c
    . Bool -> Int
    forall a. Enum a => a -> Int
    fromEnum) Bool
    gracefulDisconnect
        Ptr TcpConnection -> CInt -> IO ()
    g_tcp_connection_set_graceful_disconnect Ptr TcpConnection
    connection' CInt
    gracefulDisconnect'
        a -> IO ()
    forall a. ManagedPtrNewtype a => a -> IO ()
    touchManagedPtr a
    connection
        () -> IO ()
    forall (m :: * -> *) a. Monad m => a -> m a
    return ()

    #if defined(ENABLE_OVERLOADING)
    data TcpConnectionSetGracefulDisconnectMethodInfo
    instance (signature ~ (Bool -> m ()), MonadIO m, IsTcpConnection a) => O.MethodInfo TcpConnectionSetGracefulDisconnectMethodInfo a signature where
        overloadedMethod = tcpConnectionSetGracefulDisconnect

    #endif