{- | Copyright : Will Thompson, Iñaki García Etxebarria and Jonas Platte License : LGPL-2.1 Maintainer : Iñaki García Etxebarria (garetxe@gmail.com) 'GI.Gio.Objects.SocketClient.SocketClient' is a lightweight high-level utility class for connecting to a network host using a connection oriented socket type. You create a 'GI.Gio.Objects.SocketClient.SocketClient' object, set any options you want, and then call a sync or async connect operation, which returns a 'GI.Gio.Objects.SocketConnection.SocketConnection' subclass on success. The type of the 'GI.Gio.Objects.SocketConnection.SocketConnection' object returned depends on the type of the underlying socket that is in use. For instance, for a TCP\/IP connection it will be a 'GI.Gio.Objects.TcpConnection.TcpConnection'. As 'GI.Gio.Objects.SocketClient.SocketClient' is a lightweight object, you don\'t need to cache it. You can just create a new one any time you need one. -} module GI.Gio.Objects.SocketClient ( -- * Exported types SocketClient(..) , IsSocketClient , toSocketClient , noSocketClient , -- * Methods -- ** addApplicationProxy #method:addApplicationProxy# SocketClientAddApplicationProxyMethodInfo, socketClientAddApplicationProxy , -- ** connect #method:connect# SocketClientConnectMethodInfo , socketClientConnect , -- ** connectAsync #method:connectAsync# SocketClientConnectAsyncMethodInfo , socketClientConnectAsync , -- ** connectFinish #method:connectFinish# SocketClientConnectFinishMethodInfo , socketClientConnectFinish , -- ** connectToHost #method:connectToHost# SocketClientConnectToHostMethodInfo , socketClientConnectToHost , -- ** connectToHostAsync #method:connectToHostAsync# SocketClientConnectToHostAsyncMethodInfo, socketClientConnectToHostAsync , -- ** connectToHostFinish #method:connectToHostFinish# SocketClientConnectToHostFinishMethodInfo, socketClientConnectToHostFinish , -- ** connectToService #method:connectToService# SocketClientConnectToServiceMethodInfo , socketClientConnectToService , -- ** connectToServiceAsync #method:connectToServiceAsync# SocketClientConnectToServiceAsyncMethodInfo, socketClientConnectToServiceAsync , -- ** connectToServiceFinish #method:connectToServiceFinish# SocketClientConnectToServiceFinishMethodInfo, socketClientConnectToServiceFinish , -- ** connectToUri #method:connectToUri# SocketClientConnectToUriMethodInfo , socketClientConnectToUri , -- ** connectToUriAsync #method:connectToUriAsync# SocketClientConnectToUriAsyncMethodInfo , socketClientConnectToUriAsync , -- ** connectToUriFinish #method:connectToUriFinish# SocketClientConnectToUriFinishMethodInfo, socketClientConnectToUriFinish , -- ** getEnableProxy #method:getEnableProxy# SocketClientGetEnableProxyMethodInfo , socketClientGetEnableProxy , -- ** getFamily #method:getFamily# SocketClientGetFamilyMethodInfo , socketClientGetFamily , -- ** getLocalAddress #method:getLocalAddress# SocketClientGetLocalAddressMethodInfo , socketClientGetLocalAddress , -- ** getProtocol #method:getProtocol# SocketClientGetProtocolMethodInfo , socketClientGetProtocol , -- ** getProxyResolver #method:getProxyResolver# SocketClientGetProxyResolverMethodInfo , socketClientGetProxyResolver , -- ** getSocketType #method:getSocketType# SocketClientGetSocketTypeMethodInfo , socketClientGetSocketType , -- ** getTimeout #method:getTimeout# SocketClientGetTimeoutMethodInfo , socketClientGetTimeout , -- ** getTls #method:getTls# SocketClientGetTlsMethodInfo , socketClientGetTls , -- ** getTlsValidationFlags #method:getTlsValidationFlags# SocketClientGetTlsValidationFlagsMethodInfo, socketClientGetTlsValidationFlags , -- ** new #method:new# socketClientNew , -- ** setEnableProxy #method:setEnableProxy# SocketClientSetEnableProxyMethodInfo , socketClientSetEnableProxy , -- ** setFamily #method:setFamily# SocketClientSetFamilyMethodInfo , socketClientSetFamily , -- ** setLocalAddress #method:setLocalAddress# SocketClientSetLocalAddressMethodInfo , socketClientSetLocalAddress , -- ** setProtocol #method:setProtocol# SocketClientSetProtocolMethodInfo , socketClientSetProtocol , -- ** setProxyResolver #method:setProxyResolver# SocketClientSetProxyResolverMethodInfo , socketClientSetProxyResolver , -- ** setSocketType #method:setSocketType# SocketClientSetSocketTypeMethodInfo , socketClientSetSocketType , -- ** setTimeout #method:setTimeout# SocketClientSetTimeoutMethodInfo , socketClientSetTimeout , -- ** setTls #method:setTls# SocketClientSetTlsMethodInfo , socketClientSetTls , -- ** setTlsValidationFlags #method:setTlsValidationFlags# SocketClientSetTlsValidationFlagsMethodInfo, socketClientSetTlsValidationFlags , -- * Properties -- ** enableProxy #attr:enableProxy# SocketClientEnableProxyPropertyInfo , constructSocketClientEnableProxy , getSocketClientEnableProxy , setSocketClientEnableProxy , socketClientEnableProxy , -- ** family #attr:family# SocketClientFamilyPropertyInfo , constructSocketClientFamily , getSocketClientFamily , setSocketClientFamily , socketClientFamily , -- ** localAddress #attr:localAddress# SocketClientLocalAddressPropertyInfo , clearSocketClientLocalAddress , constructSocketClientLocalAddress , getSocketClientLocalAddress , setSocketClientLocalAddress , socketClientLocalAddress , -- ** protocol #attr:protocol# SocketClientProtocolPropertyInfo , constructSocketClientProtocol , getSocketClientProtocol , setSocketClientProtocol , socketClientProtocol , -- ** proxyResolver #attr:proxyResolver# SocketClientProxyResolverPropertyInfo , clearSocketClientProxyResolver , constructSocketClientProxyResolver , getSocketClientProxyResolver , setSocketClientProxyResolver , socketClientProxyResolver , -- ** timeout #attr:timeout# SocketClientTimeoutPropertyInfo , constructSocketClientTimeout , getSocketClientTimeout , setSocketClientTimeout , socketClientTimeout , -- ** tls #attr:tls# SocketClientTlsPropertyInfo , constructSocketClientTls , getSocketClientTls , setSocketClientTls , socketClientTls , -- ** tlsValidationFlags #attr:tlsValidationFlags# SocketClientTlsValidationFlagsPropertyInfo, constructSocketClientTlsValidationFlags , getSocketClientTlsValidationFlags , setSocketClientTlsValidationFlags , socketClientTlsValidationFlags , -- ** type #attr:type# SocketClientTypePropertyInfo , constructSocketClientType , getSocketClientType , setSocketClientType , socketClientType , -- * Signals -- ** event #signal:event# C_SocketClientEventCallback , SocketClientEventCallback , SocketClientEventSignalInfo , afterSocketClientEvent , genClosure_SocketClientEvent , mk_SocketClientEventCallback , noSocketClientEventCallback , onSocketClientEvent , wrap_SocketClientEventCallback , ) 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.ManagedPtr as B.ManagedPtr import qualified Data.GI.Base.GError as B.GError import qualified Data.GI.Base.GVariant as B.GVariant import qualified Data.GI.Base.GParamSpec as B.GParamSpec import qualified Data.GI.Base.CallStack as B.CallStack 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 GI.GObject.Objects.Object as GObject.Object import qualified GI.Gio.Callbacks as Gio.Callbacks import {-# SOURCE #-} qualified GI.Gio.Enums as Gio.Enums import {-# SOURCE #-} qualified GI.Gio.Flags as Gio.Flags import {-# SOURCE #-} qualified GI.Gio.Interfaces.AsyncResult as Gio.AsyncResult import {-# SOURCE #-} qualified GI.Gio.Interfaces.ProxyResolver as Gio.ProxyResolver import {-# SOURCE #-} qualified GI.Gio.Interfaces.SocketConnectable as Gio.SocketConnectable import {-# SOURCE #-} qualified GI.Gio.Objects.Cancellable as Gio.Cancellable import {-# SOURCE #-} qualified GI.Gio.Objects.IOStream as Gio.IOStream import {-# SOURCE #-} qualified GI.Gio.Objects.SocketAddress as Gio.SocketAddress import {-# SOURCE #-} qualified GI.Gio.Objects.SocketConnection as Gio.SocketConnection newtype SocketClient = SocketClient (ManagedPtr SocketClient) foreign import ccall "g_socket_client_get_type" c_g_socket_client_get_type :: IO GType instance GObject SocketClient where gobjectType _ = c_g_socket_client_get_type class GObject o => IsSocketClient o #if MIN_VERSION_base(4,9,0) instance {-# OVERLAPPABLE #-} (GObject a, O.UnknownAncestorError SocketClient a) => IsSocketClient a #endif instance IsSocketClient SocketClient instance GObject.Object.IsObject SocketClient toSocketClient :: IsSocketClient o => o -> IO SocketClient toSocketClient = unsafeCastTo SocketClient noSocketClient :: Maybe SocketClient noSocketClient = Nothing type family ResolveSocketClientMethod (t :: Symbol) (o :: *) :: * where ResolveSocketClientMethod "addApplicationProxy" o = SocketClientAddApplicationProxyMethodInfo ResolveSocketClientMethod "bindProperty" o = GObject.Object.ObjectBindPropertyMethodInfo ResolveSocketClientMethod "bindPropertyFull" o = GObject.Object.ObjectBindPropertyFullMethodInfo ResolveSocketClientMethod "connect" o = SocketClientConnectMethodInfo ResolveSocketClientMethod "connectAsync" o = SocketClientConnectAsyncMethodInfo ResolveSocketClientMethod "connectFinish" o = SocketClientConnectFinishMethodInfo ResolveSocketClientMethod "connectToHost" o = SocketClientConnectToHostMethodInfo ResolveSocketClientMethod "connectToHostAsync" o = SocketClientConnectToHostAsyncMethodInfo ResolveSocketClientMethod "connectToHostFinish" o = SocketClientConnectToHostFinishMethodInfo ResolveSocketClientMethod "connectToService" o = SocketClientConnectToServiceMethodInfo ResolveSocketClientMethod "connectToServiceAsync" o = SocketClientConnectToServiceAsyncMethodInfo ResolveSocketClientMethod "connectToServiceFinish" o = SocketClientConnectToServiceFinishMethodInfo ResolveSocketClientMethod "connectToUri" o = SocketClientConnectToUriMethodInfo ResolveSocketClientMethod "connectToUriAsync" o = SocketClientConnectToUriAsyncMethodInfo ResolveSocketClientMethod "connectToUriFinish" o = SocketClientConnectToUriFinishMethodInfo ResolveSocketClientMethod "forceFloating" o = GObject.Object.ObjectForceFloatingMethodInfo ResolveSocketClientMethod "freezeNotify" o = GObject.Object.ObjectFreezeNotifyMethodInfo ResolveSocketClientMethod "isFloating" o = GObject.Object.ObjectIsFloatingMethodInfo ResolveSocketClientMethod "notify" o = GObject.Object.ObjectNotifyMethodInfo ResolveSocketClientMethod "notifyByPspec" o = GObject.Object.ObjectNotifyByPspecMethodInfo ResolveSocketClientMethod "ref" o = GObject.Object.ObjectRefMethodInfo ResolveSocketClientMethod "refSink" o = GObject.Object.ObjectRefSinkMethodInfo ResolveSocketClientMethod "replaceData" o = GObject.Object.ObjectReplaceDataMethodInfo ResolveSocketClientMethod "replaceQdata" o = GObject.Object.ObjectReplaceQdataMethodInfo ResolveSocketClientMethod "runDispose" o = GObject.Object.ObjectRunDisposeMethodInfo ResolveSocketClientMethod "stealData" o = GObject.Object.ObjectStealDataMethodInfo ResolveSocketClientMethod "stealQdata" o = GObject.Object.ObjectStealQdataMethodInfo ResolveSocketClientMethod "thawNotify" o = GObject.Object.ObjectThawNotifyMethodInfo ResolveSocketClientMethod "unref" o = GObject.Object.ObjectUnrefMethodInfo ResolveSocketClientMethod "watchClosure" o = GObject.Object.ObjectWatchClosureMethodInfo ResolveSocketClientMethod "getData" o = GObject.Object.ObjectGetDataMethodInfo ResolveSocketClientMethod "getEnableProxy" o = SocketClientGetEnableProxyMethodInfo ResolveSocketClientMethod "getFamily" o = SocketClientGetFamilyMethodInfo ResolveSocketClientMethod "getLocalAddress" o = SocketClientGetLocalAddressMethodInfo ResolveSocketClientMethod "getProperty" o = GObject.Object.ObjectGetPropertyMethodInfo ResolveSocketClientMethod "getProtocol" o = SocketClientGetProtocolMethodInfo ResolveSocketClientMethod "getProxyResolver" o = SocketClientGetProxyResolverMethodInfo ResolveSocketClientMethod "getQdata" o = GObject.Object.ObjectGetQdataMethodInfo ResolveSocketClientMethod "getSocketType" o = SocketClientGetSocketTypeMethodInfo ResolveSocketClientMethod "getTimeout" o = SocketClientGetTimeoutMethodInfo ResolveSocketClientMethod "getTls" o = SocketClientGetTlsMethodInfo ResolveSocketClientMethod "getTlsValidationFlags" o = SocketClientGetTlsValidationFlagsMethodInfo ResolveSocketClientMethod "setData" o = GObject.Object.ObjectSetDataMethodInfo ResolveSocketClientMethod "setEnableProxy" o = SocketClientSetEnableProxyMethodInfo ResolveSocketClientMethod "setFamily" o = SocketClientSetFamilyMethodInfo ResolveSocketClientMethod "setLocalAddress" o = SocketClientSetLocalAddressMethodInfo ResolveSocketClientMethod "setProperty" o = GObject.Object.ObjectSetPropertyMethodInfo ResolveSocketClientMethod "setProtocol" o = SocketClientSetProtocolMethodInfo ResolveSocketClientMethod "setProxyResolver" o = SocketClientSetProxyResolverMethodInfo ResolveSocketClientMethod "setSocketType" o = SocketClientSetSocketTypeMethodInfo ResolveSocketClientMethod "setTimeout" o = SocketClientSetTimeoutMethodInfo ResolveSocketClientMethod "setTls" o = SocketClientSetTlsMethodInfo ResolveSocketClientMethod "setTlsValidationFlags" o = SocketClientSetTlsValidationFlagsMethodInfo ResolveSocketClientMethod l o = O.MethodResolutionFailed l o instance (info ~ ResolveSocketClientMethod t SocketClient, O.MethodInfo info SocketClient p) => O.IsLabelProxy t (SocketClient -> p) where fromLabelProxy _ = O.overloadedMethod (O.MethodProxy :: O.MethodProxy info) #if MIN_VERSION_base(4,9,0) instance (info ~ ResolveSocketClientMethod t SocketClient, O.MethodInfo info SocketClient p) => O.IsLabel t (SocketClient -> p) where fromLabel _ = O.overloadedMethod (O.MethodProxy :: O.MethodProxy info) #endif -- signal SocketClient::event type SocketClientEventCallback = Gio.Enums.SocketClientEvent -> Gio.SocketConnectable.SocketConnectable -> Maybe Gio.IOStream.IOStream -> IO () noSocketClientEventCallback :: Maybe SocketClientEventCallback noSocketClientEventCallback = Nothing type C_SocketClientEventCallback = Ptr () -> -- object CUInt -> Ptr Gio.SocketConnectable.SocketConnectable -> Ptr Gio.IOStream.IOStream -> Ptr () -> -- user_data IO () foreign import ccall "wrapper" mk_SocketClientEventCallback :: C_SocketClientEventCallback -> IO (FunPtr C_SocketClientEventCallback) genClosure_SocketClientEvent :: SocketClientEventCallback -> IO Closure genClosure_SocketClientEvent cb = do let cb' = wrap_SocketClientEventCallback cb mk_SocketClientEventCallback cb' >>= newCClosure wrap_SocketClientEventCallback :: SocketClientEventCallback -> Ptr () -> CUInt -> Ptr Gio.SocketConnectable.SocketConnectable -> Ptr Gio.IOStream.IOStream -> Ptr () -> IO () wrap_SocketClientEventCallback _cb _ event connectable connection _ = do let event' = (toEnum . fromIntegral) event connectable' <- (newObject Gio.SocketConnectable.SocketConnectable) connectable maybeConnection <- if connection == nullPtr then return Nothing else do connection' <- (newObject Gio.IOStream.IOStream) connection return $ Just connection' _cb event' connectable' maybeConnection onSocketClientEvent :: (IsSocketClient a, MonadIO m) => a -> SocketClientEventCallback -> m SignalHandlerId onSocketClientEvent obj cb = liftIO $ do let cb' = wrap_SocketClientEventCallback cb cb'' <- mk_SocketClientEventCallback cb' connectSignalFunPtr obj "event" cb'' SignalConnectBefore afterSocketClientEvent :: (IsSocketClient a, MonadIO m) => a -> SocketClientEventCallback -> m SignalHandlerId afterSocketClientEvent obj cb = liftIO $ do let cb' = wrap_SocketClientEventCallback cb cb'' <- mk_SocketClientEventCallback cb' connectSignalFunPtr obj "event" cb'' SignalConnectAfter -- VVV Prop "enable-proxy" -- Type: TBasicType TBoolean -- Flags: [PropertyReadable,PropertyWritable,PropertyConstruct] -- Nullable: (Just False,Just False) getSocketClientEnableProxy :: (MonadIO m, IsSocketClient o) => o -> m Bool getSocketClientEnableProxy obj = liftIO $ getObjectPropertyBool obj "enable-proxy" setSocketClientEnableProxy :: (MonadIO m, IsSocketClient o) => o -> Bool -> m () setSocketClientEnableProxy obj val = liftIO $ setObjectPropertyBool obj "enable-proxy" val constructSocketClientEnableProxy :: (IsSocketClient o) => Bool -> IO (GValueConstruct o) constructSocketClientEnableProxy val = constructObjectPropertyBool "enable-proxy" val data SocketClientEnableProxyPropertyInfo instance AttrInfo SocketClientEnableProxyPropertyInfo where type AttrAllowedOps SocketClientEnableProxyPropertyInfo = '[ 'AttrSet, 'AttrConstruct, 'AttrGet] type AttrSetTypeConstraint SocketClientEnableProxyPropertyInfo = (~) Bool type AttrBaseTypeConstraint SocketClientEnableProxyPropertyInfo = IsSocketClient type AttrGetType SocketClientEnableProxyPropertyInfo = Bool type AttrLabel SocketClientEnableProxyPropertyInfo = "enable-proxy" type AttrOrigin SocketClientEnableProxyPropertyInfo = SocketClient attrGet _ = getSocketClientEnableProxy attrSet _ = setSocketClientEnableProxy attrConstruct _ = constructSocketClientEnableProxy attrClear _ = undefined -- VVV Prop "family" -- Type: TInterface (Name {namespace = "Gio", name = "SocketFamily"}) -- Flags: [PropertyReadable,PropertyWritable,PropertyConstruct] -- Nullable: (Just False,Just False) getSocketClientFamily :: (MonadIO m, IsSocketClient o) => o -> m Gio.Enums.SocketFamily getSocketClientFamily obj = liftIO $ getObjectPropertyEnum obj "family" setSocketClientFamily :: (MonadIO m, IsSocketClient o) => o -> Gio.Enums.SocketFamily -> m () setSocketClientFamily obj val = liftIO $ setObjectPropertyEnum obj "family" val constructSocketClientFamily :: (IsSocketClient o) => Gio.Enums.SocketFamily -> IO (GValueConstruct o) constructSocketClientFamily val = constructObjectPropertyEnum "family" val data SocketClientFamilyPropertyInfo instance AttrInfo SocketClientFamilyPropertyInfo where type AttrAllowedOps SocketClientFamilyPropertyInfo = '[ 'AttrSet, 'AttrConstruct, 'AttrGet] type AttrSetTypeConstraint SocketClientFamilyPropertyInfo = (~) Gio.Enums.SocketFamily type AttrBaseTypeConstraint SocketClientFamilyPropertyInfo = IsSocketClient type AttrGetType SocketClientFamilyPropertyInfo = Gio.Enums.SocketFamily type AttrLabel SocketClientFamilyPropertyInfo = "family" type AttrOrigin SocketClientFamilyPropertyInfo = SocketClient attrGet _ = getSocketClientFamily attrSet _ = setSocketClientFamily attrConstruct _ = constructSocketClientFamily attrClear _ = undefined -- VVV Prop "local-address" -- Type: TInterface (Name {namespace = "Gio", name = "SocketAddress"}) -- Flags: [PropertyReadable,PropertyWritable,PropertyConstruct] -- Nullable: (Just False,Just True) getSocketClientLocalAddress :: (MonadIO m, IsSocketClient o) => o -> m Gio.SocketAddress.SocketAddress getSocketClientLocalAddress obj = liftIO $ checkUnexpectedNothing "getSocketClientLocalAddress" $ getObjectPropertyObject obj "local-address" Gio.SocketAddress.SocketAddress setSocketClientLocalAddress :: (MonadIO m, IsSocketClient o, Gio.SocketAddress.IsSocketAddress a) => o -> a -> m () setSocketClientLocalAddress obj val = liftIO $ setObjectPropertyObject obj "local-address" (Just val) constructSocketClientLocalAddress :: (IsSocketClient o, Gio.SocketAddress.IsSocketAddress a) => a -> IO (GValueConstruct o) constructSocketClientLocalAddress val = constructObjectPropertyObject "local-address" (Just val) clearSocketClientLocalAddress :: (MonadIO m, IsSocketClient o) => o -> m () clearSocketClientLocalAddress obj = liftIO $ setObjectPropertyObject obj "local-address" (Nothing :: Maybe Gio.SocketAddress.SocketAddress) data SocketClientLocalAddressPropertyInfo instance AttrInfo SocketClientLocalAddressPropertyInfo where type AttrAllowedOps SocketClientLocalAddressPropertyInfo = '[ 'AttrSet, 'AttrConstruct, 'AttrGet, 'AttrClear] type AttrSetTypeConstraint SocketClientLocalAddressPropertyInfo = Gio.SocketAddress.IsSocketAddress type AttrBaseTypeConstraint SocketClientLocalAddressPropertyInfo = IsSocketClient type AttrGetType SocketClientLocalAddressPropertyInfo = Gio.SocketAddress.SocketAddress type AttrLabel SocketClientLocalAddressPropertyInfo = "local-address" type AttrOrigin SocketClientLocalAddressPropertyInfo = SocketClient attrGet _ = getSocketClientLocalAddress attrSet _ = setSocketClientLocalAddress attrConstruct _ = constructSocketClientLocalAddress attrClear _ = clearSocketClientLocalAddress -- VVV Prop "protocol" -- Type: TInterface (Name {namespace = "Gio", name = "SocketProtocol"}) -- Flags: [PropertyReadable,PropertyWritable,PropertyConstruct] -- Nullable: (Just False,Just False) getSocketClientProtocol :: (MonadIO m, IsSocketClient o) => o -> m Gio.Enums.SocketProtocol getSocketClientProtocol obj = liftIO $ getObjectPropertyEnum obj "protocol" setSocketClientProtocol :: (MonadIO m, IsSocketClient o) => o -> Gio.Enums.SocketProtocol -> m () setSocketClientProtocol obj val = liftIO $ setObjectPropertyEnum obj "protocol" val constructSocketClientProtocol :: (IsSocketClient o) => Gio.Enums.SocketProtocol -> IO (GValueConstruct o) constructSocketClientProtocol val = constructObjectPropertyEnum "protocol" val data SocketClientProtocolPropertyInfo instance AttrInfo SocketClientProtocolPropertyInfo where type AttrAllowedOps SocketClientProtocolPropertyInfo = '[ 'AttrSet, 'AttrConstruct, 'AttrGet] type AttrSetTypeConstraint SocketClientProtocolPropertyInfo = (~) Gio.Enums.SocketProtocol type AttrBaseTypeConstraint SocketClientProtocolPropertyInfo = IsSocketClient type AttrGetType SocketClientProtocolPropertyInfo = Gio.Enums.SocketProtocol type AttrLabel SocketClientProtocolPropertyInfo = "protocol" type AttrOrigin SocketClientProtocolPropertyInfo = SocketClient attrGet _ = getSocketClientProtocol attrSet _ = setSocketClientProtocol attrConstruct _ = constructSocketClientProtocol attrClear _ = undefined -- VVV Prop "proxy-resolver" -- Type: TInterface (Name {namespace = "Gio", name = "ProxyResolver"}) -- Flags: [PropertyReadable,PropertyWritable,PropertyConstruct] -- Nullable: (Just False,Just True) getSocketClientProxyResolver :: (MonadIO m, IsSocketClient o) => o -> m Gio.ProxyResolver.ProxyResolver getSocketClientProxyResolver obj = liftIO $ checkUnexpectedNothing "getSocketClientProxyResolver" $ getObjectPropertyObject obj "proxy-resolver" Gio.ProxyResolver.ProxyResolver setSocketClientProxyResolver :: (MonadIO m, IsSocketClient o, Gio.ProxyResolver.IsProxyResolver a) => o -> a -> m () setSocketClientProxyResolver obj val = liftIO $ setObjectPropertyObject obj "proxy-resolver" (Just val) constructSocketClientProxyResolver :: (IsSocketClient o, Gio.ProxyResolver.IsProxyResolver a) => a -> IO (GValueConstruct o) constructSocketClientProxyResolver val = constructObjectPropertyObject "proxy-resolver" (Just val) clearSocketClientProxyResolver :: (MonadIO m, IsSocketClient o) => o -> m () clearSocketClientProxyResolver obj = liftIO $ setObjectPropertyObject obj "proxy-resolver" (Nothing :: Maybe Gio.ProxyResolver.ProxyResolver) data SocketClientProxyResolverPropertyInfo instance AttrInfo SocketClientProxyResolverPropertyInfo where type AttrAllowedOps SocketClientProxyResolverPropertyInfo = '[ 'AttrSet, 'AttrConstruct, 'AttrGet, 'AttrClear] type AttrSetTypeConstraint SocketClientProxyResolverPropertyInfo = Gio.ProxyResolver.IsProxyResolver type AttrBaseTypeConstraint SocketClientProxyResolverPropertyInfo = IsSocketClient type AttrGetType SocketClientProxyResolverPropertyInfo = Gio.ProxyResolver.ProxyResolver type AttrLabel SocketClientProxyResolverPropertyInfo = "proxy-resolver" type AttrOrigin SocketClientProxyResolverPropertyInfo = SocketClient attrGet _ = getSocketClientProxyResolver attrSet _ = setSocketClientProxyResolver attrConstruct _ = constructSocketClientProxyResolver attrClear _ = clearSocketClientProxyResolver -- VVV Prop "timeout" -- Type: TBasicType TUInt -- Flags: [PropertyReadable,PropertyWritable,PropertyConstruct] -- Nullable: (Just False,Just False) getSocketClientTimeout :: (MonadIO m, IsSocketClient o) => o -> m Word32 getSocketClientTimeout obj = liftIO $ getObjectPropertyUInt32 obj "timeout" setSocketClientTimeout :: (MonadIO m, IsSocketClient o) => o -> Word32 -> m () setSocketClientTimeout obj val = liftIO $ setObjectPropertyUInt32 obj "timeout" val constructSocketClientTimeout :: (IsSocketClient o) => Word32 -> IO (GValueConstruct o) constructSocketClientTimeout val = constructObjectPropertyUInt32 "timeout" val data SocketClientTimeoutPropertyInfo instance AttrInfo SocketClientTimeoutPropertyInfo where type AttrAllowedOps SocketClientTimeoutPropertyInfo = '[ 'AttrSet, 'AttrConstruct, 'AttrGet] type AttrSetTypeConstraint SocketClientTimeoutPropertyInfo = (~) Word32 type AttrBaseTypeConstraint SocketClientTimeoutPropertyInfo = IsSocketClient type AttrGetType SocketClientTimeoutPropertyInfo = Word32 type AttrLabel SocketClientTimeoutPropertyInfo = "timeout" type AttrOrigin SocketClientTimeoutPropertyInfo = SocketClient attrGet _ = getSocketClientTimeout attrSet _ = setSocketClientTimeout attrConstruct _ = constructSocketClientTimeout attrClear _ = undefined -- VVV Prop "tls" -- Type: TBasicType TBoolean -- Flags: [PropertyReadable,PropertyWritable,PropertyConstruct] -- Nullable: (Just False,Just False) getSocketClientTls :: (MonadIO m, IsSocketClient o) => o -> m Bool getSocketClientTls obj = liftIO $ getObjectPropertyBool obj "tls" setSocketClientTls :: (MonadIO m, IsSocketClient o) => o -> Bool -> m () setSocketClientTls obj val = liftIO $ setObjectPropertyBool obj "tls" val constructSocketClientTls :: (IsSocketClient o) => Bool -> IO (GValueConstruct o) constructSocketClientTls val = constructObjectPropertyBool "tls" val data SocketClientTlsPropertyInfo instance AttrInfo SocketClientTlsPropertyInfo where type AttrAllowedOps SocketClientTlsPropertyInfo = '[ 'AttrSet, 'AttrConstruct, 'AttrGet] type AttrSetTypeConstraint SocketClientTlsPropertyInfo = (~) Bool type AttrBaseTypeConstraint SocketClientTlsPropertyInfo = IsSocketClient type AttrGetType SocketClientTlsPropertyInfo = Bool type AttrLabel SocketClientTlsPropertyInfo = "tls" type AttrOrigin SocketClientTlsPropertyInfo = SocketClient attrGet _ = getSocketClientTls attrSet _ = setSocketClientTls attrConstruct _ = constructSocketClientTls attrClear _ = undefined -- VVV Prop "tls-validation-flags" -- Type: TInterface (Name {namespace = "Gio", name = "TlsCertificateFlags"}) -- Flags: [PropertyReadable,PropertyWritable,PropertyConstruct] -- Nullable: (Just False,Just False) getSocketClientTlsValidationFlags :: (MonadIO m, IsSocketClient o) => o -> m [Gio.Flags.TlsCertificateFlags] getSocketClientTlsValidationFlags obj = liftIO $ getObjectPropertyFlags obj "tls-validation-flags" setSocketClientTlsValidationFlags :: (MonadIO m, IsSocketClient o) => o -> [Gio.Flags.TlsCertificateFlags] -> m () setSocketClientTlsValidationFlags obj val = liftIO $ setObjectPropertyFlags obj "tls-validation-flags" val constructSocketClientTlsValidationFlags :: (IsSocketClient o) => [Gio.Flags.TlsCertificateFlags] -> IO (GValueConstruct o) constructSocketClientTlsValidationFlags val = constructObjectPropertyFlags "tls-validation-flags" val data SocketClientTlsValidationFlagsPropertyInfo instance AttrInfo SocketClientTlsValidationFlagsPropertyInfo where type AttrAllowedOps SocketClientTlsValidationFlagsPropertyInfo = '[ 'AttrSet, 'AttrConstruct, 'AttrGet] type AttrSetTypeConstraint SocketClientTlsValidationFlagsPropertyInfo = (~) [Gio.Flags.TlsCertificateFlags] type AttrBaseTypeConstraint SocketClientTlsValidationFlagsPropertyInfo = IsSocketClient type AttrGetType SocketClientTlsValidationFlagsPropertyInfo = [Gio.Flags.TlsCertificateFlags] type AttrLabel SocketClientTlsValidationFlagsPropertyInfo = "tls-validation-flags" type AttrOrigin SocketClientTlsValidationFlagsPropertyInfo = SocketClient attrGet _ = getSocketClientTlsValidationFlags attrSet _ = setSocketClientTlsValidationFlags attrConstruct _ = constructSocketClientTlsValidationFlags attrClear _ = undefined -- VVV Prop "type" -- Type: TInterface (Name {namespace = "Gio", name = "SocketType"}) -- Flags: [PropertyReadable,PropertyWritable,PropertyConstruct] -- Nullable: (Nothing,Nothing) getSocketClientType :: (MonadIO m, IsSocketClient o) => o -> m Gio.Enums.SocketType getSocketClientType obj = liftIO $ getObjectPropertyEnum obj "type" setSocketClientType :: (MonadIO m, IsSocketClient o) => o -> Gio.Enums.SocketType -> m () setSocketClientType obj val = liftIO $ setObjectPropertyEnum obj "type" val constructSocketClientType :: (IsSocketClient o) => Gio.Enums.SocketType -> IO (GValueConstruct o) constructSocketClientType val = constructObjectPropertyEnum "type" val data SocketClientTypePropertyInfo instance AttrInfo SocketClientTypePropertyInfo where type AttrAllowedOps SocketClientTypePropertyInfo = '[ 'AttrSet, 'AttrConstruct, 'AttrGet] type AttrSetTypeConstraint SocketClientTypePropertyInfo = (~) Gio.Enums.SocketType type AttrBaseTypeConstraint SocketClientTypePropertyInfo = IsSocketClient type AttrGetType SocketClientTypePropertyInfo = Gio.Enums.SocketType type AttrLabel SocketClientTypePropertyInfo = "type" type AttrOrigin SocketClientTypePropertyInfo = SocketClient attrGet _ = getSocketClientType attrSet _ = setSocketClientType attrConstruct _ = constructSocketClientType attrClear _ = undefined instance O.HasAttributeList SocketClient type instance O.AttributeList SocketClient = SocketClientAttributeList type SocketClientAttributeList = ('[ '("enableProxy", SocketClientEnableProxyPropertyInfo), '("family", SocketClientFamilyPropertyInfo), '("localAddress", SocketClientLocalAddressPropertyInfo), '("protocol", SocketClientProtocolPropertyInfo), '("proxyResolver", SocketClientProxyResolverPropertyInfo), '("timeout", SocketClientTimeoutPropertyInfo), '("tls", SocketClientTlsPropertyInfo), '("tlsValidationFlags", SocketClientTlsValidationFlagsPropertyInfo), '("type", SocketClientTypePropertyInfo)] :: [(Symbol, *)]) socketClientEnableProxy :: AttrLabelProxy "enableProxy" socketClientEnableProxy = AttrLabelProxy socketClientFamily :: AttrLabelProxy "family" socketClientFamily = AttrLabelProxy socketClientLocalAddress :: AttrLabelProxy "localAddress" socketClientLocalAddress = AttrLabelProxy socketClientProtocol :: AttrLabelProxy "protocol" socketClientProtocol = AttrLabelProxy socketClientProxyResolver :: AttrLabelProxy "proxyResolver" socketClientProxyResolver = AttrLabelProxy socketClientTimeout :: AttrLabelProxy "timeout" socketClientTimeout = AttrLabelProxy socketClientTls :: AttrLabelProxy "tls" socketClientTls = AttrLabelProxy socketClientTlsValidationFlags :: AttrLabelProxy "tlsValidationFlags" socketClientTlsValidationFlags = AttrLabelProxy socketClientType :: AttrLabelProxy "type" socketClientType = AttrLabelProxy data SocketClientEventSignalInfo instance SignalInfo SocketClientEventSignalInfo where type HaskellCallbackType SocketClientEventSignalInfo = SocketClientEventCallback connectSignal _ obj cb connectMode = do let cb' = wrap_SocketClientEventCallback cb cb'' <- mk_SocketClientEventCallback cb' connectSignalFunPtr obj "event" cb'' connectMode type instance O.SignalList SocketClient = SocketClientSignalList type SocketClientSignalList = ('[ '("event", SocketClientEventSignalInfo), '("notify", GObject.Object.ObjectNotifySignalInfo)] :: [(Symbol, *)]) -- method SocketClient::new -- method type : Constructor -- Args : [] -- Lengths : [] -- returnType : Just (TInterface (Name {namespace = "Gio", name = "SocketClient"})) -- throws : False -- Skip return : False foreign import ccall "g_socket_client_new" g_socket_client_new :: IO (Ptr SocketClient) {- | Creates a new 'GI.Gio.Objects.SocketClient.SocketClient' with the default options. @since 2.22 -} socketClientNew :: (B.CallStack.HasCallStack, MonadIO m) => m SocketClient {- ^ __Returns:__ a 'GI.Gio.Objects.SocketClient.SocketClient'. Free the returned object with 'GI.GObject.Objects.Object.objectUnref'. -} socketClientNew = liftIO $ do result <- g_socket_client_new checkUnexpectedReturnNULL "socketClientNew" result result' <- (wrapObject SocketClient) result return result' -- method SocketClient::add_application_proxy -- method type : OrdinaryMethod -- Args : [Arg {argCName = "client", argType = TInterface (Name {namespace = "Gio", name = "SocketClient"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GSocketClient", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "protocol", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "The proxy protocol", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}] -- Lengths : [] -- returnType : Nothing -- throws : False -- Skip return : False foreign import ccall "g_socket_client_add_application_proxy" g_socket_client_add_application_proxy :: Ptr SocketClient -> -- client : TInterface (Name {namespace = "Gio", name = "SocketClient"}) CString -> -- protocol : TBasicType TUTF8 IO () {- | Enable proxy protocols to be handled by the application. When the indicated proxy protocol is returned by the 'GI.Gio.Interfaces.ProxyResolver.ProxyResolver', 'GI.Gio.Objects.SocketClient.SocketClient' will consider this protocol as supported but will not try to find a 'GI.Gio.Interfaces.Proxy.Proxy' instance to handle handshaking. The application must check for this case by calling 'GI.Gio.Objects.SocketConnection.socketConnectionGetRemoteAddress' on the returned 'GI.Gio.Objects.SocketConnection.SocketConnection', and seeing if it\'s a 'GI.Gio.Objects.ProxyAddress.ProxyAddress' of the appropriate type, to determine whether or not it needs to handle the proxy handshaking itself. This should be used for proxy protocols that are dialects of another protocol such as HTTP proxy. It also allows cohabitation of proxy protocols that are reused between protocols. A good example is HTTP. It can be used to proxy HTTP, FTP and Gopher and can also be use as generic socket proxy through the HTTP CONNECT method. When the proxy is detected as being an application proxy, TLS handshake will be skipped. This is required to let the application do the proxy specific handshake. -} socketClientAddApplicationProxy :: (B.CallStack.HasCallStack, MonadIO m, IsSocketClient a) => a {- ^ /@client@/: a 'GI.Gio.Objects.SocketClient.SocketClient' -} -> T.Text {- ^ /@protocol@/: The proxy protocol -} -> m () socketClientAddApplicationProxy client protocol = liftIO $ do client' <- unsafeManagedPtrCastPtr client protocol' <- textToCString protocol g_socket_client_add_application_proxy client' protocol' touchManagedPtr client freeMem protocol' return () data SocketClientAddApplicationProxyMethodInfo instance (signature ~ (T.Text -> m ()), MonadIO m, IsSocketClient a) => O.MethodInfo SocketClientAddApplicationProxyMethodInfo a signature where overloadedMethod _ = socketClientAddApplicationProxy -- method SocketClient::connect -- method type : OrdinaryMethod -- Args : [Arg {argCName = "client", argType = TInterface (Name {namespace = "Gio", name = "SocketClient"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GSocketClient.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "connectable", argType = TInterface (Name {namespace = "Gio", name = "SocketConnectable"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GSocketConnectable specifying the remote address.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "cancellable", argType = TInterface (Name {namespace = "Gio", name = "Cancellable"}), direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "optional #GCancellable object, %NULL to ignore.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}] -- Lengths : [] -- returnType : Just (TInterface (Name {namespace = "Gio", name = "SocketConnection"})) -- throws : True -- Skip return : False foreign import ccall "g_socket_client_connect" g_socket_client_connect :: Ptr SocketClient -> -- client : TInterface (Name {namespace = "Gio", name = "SocketClient"}) Ptr Gio.SocketConnectable.SocketConnectable -> -- connectable : TInterface (Name {namespace = "Gio", name = "SocketConnectable"}) Ptr Gio.Cancellable.Cancellable -> -- cancellable : TInterface (Name {namespace = "Gio", name = "Cancellable"}) Ptr (Ptr GError) -> -- error IO (Ptr Gio.SocketConnection.SocketConnection) {- | Tries to resolve the /@connectable@/ and make a network connection to it. Upon a successful connection, a new 'GI.Gio.Objects.SocketConnection.SocketConnection' is constructed and returned. The caller owns this new object and must drop their reference to it when finished with it. The type of the 'GI.Gio.Objects.SocketConnection.SocketConnection' object returned depends on the type of the underlying socket that is used. For instance, for a TCP\/IP connection it will be a 'GI.Gio.Objects.TcpConnection.TcpConnection'. The socket created will be the same family as the address that the /@connectable@/ resolves to, unless family is set with 'GI.Gio.Objects.SocketClient.socketClientSetFamily' or indirectly via 'GI.Gio.Objects.SocketClient.socketClientSetLocalAddress'. The socket type defaults to 'GI.Gio.Enums.SocketTypeStream' but can be set with 'GI.Gio.Objects.SocketClient.socketClientSetSocketType'. If a local address is specified with 'GI.Gio.Objects.SocketClient.socketClientSetLocalAddress' the socket will be bound to this address before connecting. @since 2.22 -} socketClientConnect :: (B.CallStack.HasCallStack, MonadIO m, IsSocketClient a, Gio.SocketConnectable.IsSocketConnectable b, Gio.Cancellable.IsCancellable c) => a {- ^ /@client@/: a 'GI.Gio.Objects.SocketClient.SocketClient'. -} -> b {- ^ /@connectable@/: a 'GI.Gio.Interfaces.SocketConnectable.SocketConnectable' specifying the remote address. -} -> Maybe (c) {- ^ /@cancellable@/: optional 'GI.Gio.Objects.Cancellable.Cancellable' object, 'Nothing' to ignore. -} -> m Gio.SocketConnection.SocketConnection {- ^ __Returns:__ a 'GI.Gio.Objects.SocketConnection.SocketConnection' on success, 'Nothing' on error. /(Can throw 'Data.GI.Base.GError.GError')/ -} socketClientConnect client connectable cancellable = liftIO $ do client' <- unsafeManagedPtrCastPtr client connectable' <- unsafeManagedPtrCastPtr connectable maybeCancellable <- case cancellable of Nothing -> return nullPtr Just jCancellable -> do jCancellable' <- unsafeManagedPtrCastPtr jCancellable return jCancellable' onException (do result <- propagateGError $ g_socket_client_connect client' connectable' maybeCancellable checkUnexpectedReturnNULL "socketClientConnect" result result' <- (wrapObject Gio.SocketConnection.SocketConnection) result touchManagedPtr client touchManagedPtr connectable whenJust cancellable touchManagedPtr return result' ) (do return () ) data SocketClientConnectMethodInfo instance (signature ~ (b -> Maybe (c) -> m Gio.SocketConnection.SocketConnection), MonadIO m, IsSocketClient a, Gio.SocketConnectable.IsSocketConnectable b, Gio.Cancellable.IsCancellable c) => O.MethodInfo SocketClientConnectMethodInfo a signature where overloadedMethod _ = socketClientConnect -- method SocketClient::connect_async -- method type : OrdinaryMethod -- Args : [Arg {argCName = "client", argType = TInterface (Name {namespace = "Gio", name = "SocketClient"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GSocketClient", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "connectable", argType = TInterface (Name {namespace = "Gio", name = "SocketConnectable"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GSocketConnectable specifying the remote address.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "cancellable", argType = TInterface (Name {namespace = "Gio", name = "Cancellable"}), direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "a #GCancellable, or %NULL", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "callback", argType = TInterface (Name {namespace = "Gio", name = "AsyncReadyCallback"}), direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "a #GAsyncReadyCallback", sinceVersion = Nothing}, argScope = ScopeTypeAsync, argClosure = 4, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "user_data", argType = TBasicType TPtr, direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "user data for the callback", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}] -- Lengths : [] -- returnType : Nothing -- throws : False -- Skip return : False foreign import ccall "g_socket_client_connect_async" g_socket_client_connect_async :: Ptr SocketClient -> -- client : TInterface (Name {namespace = "Gio", name = "SocketClient"}) Ptr Gio.SocketConnectable.SocketConnectable -> -- connectable : TInterface (Name {namespace = "Gio", name = "SocketConnectable"}) Ptr Gio.Cancellable.Cancellable -> -- cancellable : TInterface (Name {namespace = "Gio", name = "Cancellable"}) FunPtr Gio.Callbacks.C_AsyncReadyCallback -> -- callback : TInterface (Name {namespace = "Gio", name = "AsyncReadyCallback"}) Ptr () -> -- user_data : TBasicType TPtr IO () {- | This is the asynchronous version of 'GI.Gio.Objects.SocketClient.socketClientConnect'. When the operation is finished /@callback@/ will be called. You can then call 'GI.Gio.Objects.SocketClient.socketClientConnectFinish' to get the result of the operation. @since 2.22 -} socketClientConnectAsync :: (B.CallStack.HasCallStack, MonadIO m, IsSocketClient a, Gio.SocketConnectable.IsSocketConnectable b, Gio.Cancellable.IsCancellable c) => a {- ^ /@client@/: a 'GI.Gio.Objects.SocketClient.SocketClient' -} -> b {- ^ /@connectable@/: a 'GI.Gio.Interfaces.SocketConnectable.SocketConnectable' specifying the remote address. -} -> Maybe (c) {- ^ /@cancellable@/: a 'GI.Gio.Objects.Cancellable.Cancellable', or 'Nothing' -} -> Maybe (Gio.Callbacks.AsyncReadyCallback) {- ^ /@callback@/: a 'GI.Gio.Callbacks.AsyncReadyCallback' -} -> m () socketClientConnectAsync client connectable cancellable callback = liftIO $ do client' <- unsafeManagedPtrCastPtr client connectable' <- unsafeManagedPtrCastPtr connectable maybeCancellable <- case cancellable of Nothing -> return nullPtr Just jCancellable -> do jCancellable' <- unsafeManagedPtrCastPtr jCancellable return jCancellable' ptrcallback <- callocMem :: IO (Ptr (FunPtr Gio.Callbacks.C_AsyncReadyCallback)) maybeCallback <- case callback of Nothing -> return (castPtrToFunPtr nullPtr) Just jCallback -> do jCallback' <- Gio.Callbacks.mk_AsyncReadyCallback (Gio.Callbacks.wrap_AsyncReadyCallback (Just ptrcallback) (Gio.Callbacks.drop_closures_AsyncReadyCallback jCallback)) poke ptrcallback jCallback' return jCallback' let userData = nullPtr g_socket_client_connect_async client' connectable' maybeCancellable maybeCallback userData touchManagedPtr client touchManagedPtr connectable whenJust cancellable touchManagedPtr return () data SocketClientConnectAsyncMethodInfo instance (signature ~ (b -> Maybe (c) -> Maybe (Gio.Callbacks.AsyncReadyCallback) -> m ()), MonadIO m, IsSocketClient a, Gio.SocketConnectable.IsSocketConnectable b, Gio.Cancellable.IsCancellable c) => O.MethodInfo SocketClientConnectAsyncMethodInfo a signature where overloadedMethod _ = socketClientConnectAsync -- method SocketClient::connect_finish -- method type : OrdinaryMethod -- Args : [Arg {argCName = "client", argType = TInterface (Name {namespace = "Gio", name = "SocketClient"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GSocketClient.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "result", argType = TInterface (Name {namespace = "Gio", name = "AsyncResult"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GAsyncResult.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}] -- Lengths : [] -- returnType : Just (TInterface (Name {namespace = "Gio", name = "SocketConnection"})) -- throws : True -- Skip return : False foreign import ccall "g_socket_client_connect_finish" g_socket_client_connect_finish :: Ptr SocketClient -> -- client : TInterface (Name {namespace = "Gio", name = "SocketClient"}) Ptr Gio.AsyncResult.AsyncResult -> -- result : TInterface (Name {namespace = "Gio", name = "AsyncResult"}) Ptr (Ptr GError) -> -- error IO (Ptr Gio.SocketConnection.SocketConnection) {- | Finishes an async connect operation. See 'GI.Gio.Objects.SocketClient.socketClientConnectAsync' @since 2.22 -} socketClientConnectFinish :: (B.CallStack.HasCallStack, MonadIO m, IsSocketClient a, Gio.AsyncResult.IsAsyncResult b) => a {- ^ /@client@/: a 'GI.Gio.Objects.SocketClient.SocketClient'. -} -> b {- ^ /@result@/: a 'GI.Gio.Interfaces.AsyncResult.AsyncResult'. -} -> m Gio.SocketConnection.SocketConnection {- ^ __Returns:__ a 'GI.Gio.Objects.SocketConnection.SocketConnection' on success, 'Nothing' on error. /(Can throw 'Data.GI.Base.GError.GError')/ -} socketClientConnectFinish client result_ = liftIO $ do client' <- unsafeManagedPtrCastPtr client result_' <- unsafeManagedPtrCastPtr result_ onException (do result <- propagateGError $ g_socket_client_connect_finish client' result_' checkUnexpectedReturnNULL "socketClientConnectFinish" result result' <- (wrapObject Gio.SocketConnection.SocketConnection) result touchManagedPtr client touchManagedPtr result_ return result' ) (do return () ) data SocketClientConnectFinishMethodInfo instance (signature ~ (b -> m Gio.SocketConnection.SocketConnection), MonadIO m, IsSocketClient a, Gio.AsyncResult.IsAsyncResult b) => O.MethodInfo SocketClientConnectFinishMethodInfo a signature where overloadedMethod _ = socketClientConnectFinish -- method SocketClient::connect_to_host -- method type : OrdinaryMethod -- Args : [Arg {argCName = "client", argType = TInterface (Name {namespace = "Gio", name = "SocketClient"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GSocketClient", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "host_and_port", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the name and optionally port of the host to connect to", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "default_port", argType = TBasicType TUInt16, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the default port to connect to", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "cancellable", argType = TInterface (Name {namespace = "Gio", name = "Cancellable"}), direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "a #GCancellable, or %NULL", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}] -- Lengths : [] -- returnType : Just (TInterface (Name {namespace = "Gio", name = "SocketConnection"})) -- throws : True -- Skip return : False foreign import ccall "g_socket_client_connect_to_host" g_socket_client_connect_to_host :: Ptr SocketClient -> -- client : TInterface (Name {namespace = "Gio", name = "SocketClient"}) CString -> -- host_and_port : TBasicType TUTF8 Word16 -> -- default_port : TBasicType TUInt16 Ptr Gio.Cancellable.Cancellable -> -- cancellable : TInterface (Name {namespace = "Gio", name = "Cancellable"}) Ptr (Ptr GError) -> -- error IO (Ptr Gio.SocketConnection.SocketConnection) {- | This is a helper function for 'GI.Gio.Objects.SocketClient.socketClientConnect'. Attempts to create a TCP connection to the named host. /@hostAndPort@/ may be in any of a number of recognized formats; an IPv6 address, an IPv4 address, or a domain name (in which case a DNS lookup is performed). Quoting with [] is supported for all address types. A port override may be specified in the usual way with a colon. Ports may be given as decimal numbers or symbolic names (in which case an \/etc\/services lookup is performed). If no port override is given in /@hostAndPort@/ then /@defaultPort@/ will be used as the port number to connect to. In general, /@hostAndPort@/ is expected to be provided by the user (allowing them to give the hostname, and a port override if necessary) and /@defaultPort@/ is expected to be provided by the application. In the case that an IP address is given, a single connection attempt is made. In the case that a name is given, multiple connection attempts may be made, in turn and according to the number of address records in DNS, until a connection succeeds. Upon a successful connection, a new 'GI.Gio.Objects.SocketConnection.SocketConnection' is constructed and returned. The caller owns this new object and must drop their reference to it when finished with it. In the event of any failure (DNS error, service not found, no hosts connectable) 'Nothing' is returned and /@error@/ (if non-'Nothing') is set accordingly. @since 2.22 -} socketClientConnectToHost :: (B.CallStack.HasCallStack, MonadIO m, IsSocketClient a, Gio.Cancellable.IsCancellable b) => a {- ^ /@client@/: a 'GI.Gio.Objects.SocketClient.SocketClient' -} -> T.Text {- ^ /@hostAndPort@/: the name and optionally port of the host to connect to -} -> Word16 {- ^ /@defaultPort@/: the default port to connect to -} -> Maybe (b) {- ^ /@cancellable@/: a 'GI.Gio.Objects.Cancellable.Cancellable', or 'Nothing' -} -> m Gio.SocketConnection.SocketConnection {- ^ __Returns:__ a 'GI.Gio.Objects.SocketConnection.SocketConnection' on success, 'Nothing' on error. /(Can throw 'Data.GI.Base.GError.GError')/ -} socketClientConnectToHost client hostAndPort defaultPort cancellable = liftIO $ do client' <- unsafeManagedPtrCastPtr client hostAndPort' <- textToCString hostAndPort maybeCancellable <- case cancellable of Nothing -> return nullPtr Just jCancellable -> do jCancellable' <- unsafeManagedPtrCastPtr jCancellable return jCancellable' onException (do result <- propagateGError $ g_socket_client_connect_to_host client' hostAndPort' defaultPort maybeCancellable checkUnexpectedReturnNULL "socketClientConnectToHost" result result' <- (wrapObject Gio.SocketConnection.SocketConnection) result touchManagedPtr client whenJust cancellable touchManagedPtr freeMem hostAndPort' return result' ) (do freeMem hostAndPort' ) data SocketClientConnectToHostMethodInfo instance (signature ~ (T.Text -> Word16 -> Maybe (b) -> m Gio.SocketConnection.SocketConnection), MonadIO m, IsSocketClient a, Gio.Cancellable.IsCancellable b) => O.MethodInfo SocketClientConnectToHostMethodInfo a signature where overloadedMethod _ = socketClientConnectToHost -- method SocketClient::connect_to_host_async -- method type : OrdinaryMethod -- Args : [Arg {argCName = "client", argType = TInterface (Name {namespace = "Gio", name = "SocketClient"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GSocketClient", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "host_and_port", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the name and optionally the port of the host to connect to", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "default_port", argType = TBasicType TUInt16, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the default port to connect to", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "cancellable", argType = TInterface (Name {namespace = "Gio", name = "Cancellable"}), direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "a #GCancellable, or %NULL", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "callback", argType = TInterface (Name {namespace = "Gio", name = "AsyncReadyCallback"}), direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "a #GAsyncReadyCallback", sinceVersion = Nothing}, argScope = ScopeTypeAsync, argClosure = 5, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "user_data", argType = TBasicType TPtr, direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "user data for the callback", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}] -- Lengths : [] -- returnType : Nothing -- throws : False -- Skip return : False foreign import ccall "g_socket_client_connect_to_host_async" g_socket_client_connect_to_host_async :: Ptr SocketClient -> -- client : TInterface (Name {namespace = "Gio", name = "SocketClient"}) CString -> -- host_and_port : TBasicType TUTF8 Word16 -> -- default_port : TBasicType TUInt16 Ptr Gio.Cancellable.Cancellable -> -- cancellable : TInterface (Name {namespace = "Gio", name = "Cancellable"}) FunPtr Gio.Callbacks.C_AsyncReadyCallback -> -- callback : TInterface (Name {namespace = "Gio", name = "AsyncReadyCallback"}) Ptr () -> -- user_data : TBasicType TPtr IO () {- | This is the asynchronous version of 'GI.Gio.Objects.SocketClient.socketClientConnectToHost'. When the operation is finished /@callback@/ will be called. You can then call 'GI.Gio.Objects.SocketClient.socketClientConnectToHostFinish' to get the result of the operation. @since 2.22 -} socketClientConnectToHostAsync :: (B.CallStack.HasCallStack, MonadIO m, IsSocketClient a, Gio.Cancellable.IsCancellable b) => a {- ^ /@client@/: a 'GI.Gio.Objects.SocketClient.SocketClient' -} -> T.Text {- ^ /@hostAndPort@/: the name and optionally the port of the host to connect to -} -> Word16 {- ^ /@defaultPort@/: the default port to connect to -} -> Maybe (b) {- ^ /@cancellable@/: a 'GI.Gio.Objects.Cancellable.Cancellable', or 'Nothing' -} -> Maybe (Gio.Callbacks.AsyncReadyCallback) {- ^ /@callback@/: a 'GI.Gio.Callbacks.AsyncReadyCallback' -} -> m () socketClientConnectToHostAsync client hostAndPort defaultPort cancellable callback = liftIO $ do client' <- unsafeManagedPtrCastPtr client hostAndPort' <- textToCString hostAndPort maybeCancellable <- case cancellable of Nothing -> return nullPtr Just jCancellable -> do jCancellable' <- unsafeManagedPtrCastPtr jCancellable return jCancellable' ptrcallback <- callocMem :: IO (Ptr (FunPtr Gio.Callbacks.C_AsyncReadyCallback)) maybeCallback <- case callback of Nothing -> return (castPtrToFunPtr nullPtr) Just jCallback -> do jCallback' <- Gio.Callbacks.mk_AsyncReadyCallback (Gio.Callbacks.wrap_AsyncReadyCallback (Just ptrcallback) (Gio.Callbacks.drop_closures_AsyncReadyCallback jCallback)) poke ptrcallback jCallback' return jCallback' let userData = nullPtr g_socket_client_connect_to_host_async client' hostAndPort' defaultPort maybeCancellable maybeCallback userData touchManagedPtr client whenJust cancellable touchManagedPtr freeMem hostAndPort' return () data SocketClientConnectToHostAsyncMethodInfo instance (signature ~ (T.Text -> Word16 -> Maybe (b) -> Maybe (Gio.Callbacks.AsyncReadyCallback) -> m ()), MonadIO m, IsSocketClient a, Gio.Cancellable.IsCancellable b) => O.MethodInfo SocketClientConnectToHostAsyncMethodInfo a signature where overloadedMethod _ = socketClientConnectToHostAsync -- method SocketClient::connect_to_host_finish -- method type : OrdinaryMethod -- Args : [Arg {argCName = "client", argType = TInterface (Name {namespace = "Gio", name = "SocketClient"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GSocketClient.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "result", argType = TInterface (Name {namespace = "Gio", name = "AsyncResult"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GAsyncResult.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}] -- Lengths : [] -- returnType : Just (TInterface (Name {namespace = "Gio", name = "SocketConnection"})) -- throws : True -- Skip return : False foreign import ccall "g_socket_client_connect_to_host_finish" g_socket_client_connect_to_host_finish :: Ptr SocketClient -> -- client : TInterface (Name {namespace = "Gio", name = "SocketClient"}) Ptr Gio.AsyncResult.AsyncResult -> -- result : TInterface (Name {namespace = "Gio", name = "AsyncResult"}) Ptr (Ptr GError) -> -- error IO (Ptr Gio.SocketConnection.SocketConnection) {- | Finishes an async connect operation. See 'GI.Gio.Objects.SocketClient.socketClientConnectToHostAsync' @since 2.22 -} socketClientConnectToHostFinish :: (B.CallStack.HasCallStack, MonadIO m, IsSocketClient a, Gio.AsyncResult.IsAsyncResult b) => a {- ^ /@client@/: a 'GI.Gio.Objects.SocketClient.SocketClient'. -} -> b {- ^ /@result@/: a 'GI.Gio.Interfaces.AsyncResult.AsyncResult'. -} -> m Gio.SocketConnection.SocketConnection {- ^ __Returns:__ a 'GI.Gio.Objects.SocketConnection.SocketConnection' on success, 'Nothing' on error. /(Can throw 'Data.GI.Base.GError.GError')/ -} socketClientConnectToHostFinish client result_ = liftIO $ do client' <- unsafeManagedPtrCastPtr client result_' <- unsafeManagedPtrCastPtr result_ onException (do result <- propagateGError $ g_socket_client_connect_to_host_finish client' result_' checkUnexpectedReturnNULL "socketClientConnectToHostFinish" result result' <- (wrapObject Gio.SocketConnection.SocketConnection) result touchManagedPtr client touchManagedPtr result_ return result' ) (do return () ) data SocketClientConnectToHostFinishMethodInfo instance (signature ~ (b -> m Gio.SocketConnection.SocketConnection), MonadIO m, IsSocketClient a, Gio.AsyncResult.IsAsyncResult b) => O.MethodInfo SocketClientConnectToHostFinishMethodInfo a signature where overloadedMethod _ = socketClientConnectToHostFinish -- method SocketClient::connect_to_service -- method type : OrdinaryMethod -- Args : [Arg {argCName = "client", argType = TInterface (Name {namespace = "Gio", name = "SocketClient"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GSocketConnection", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "domain", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a domain name", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "service", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the name of the service to connect to", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "cancellable", argType = TInterface (Name {namespace = "Gio", name = "Cancellable"}), direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "a #GCancellable, or %NULL", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}] -- Lengths : [] -- returnType : Just (TInterface (Name {namespace = "Gio", name = "SocketConnection"})) -- throws : True -- Skip return : False foreign import ccall "g_socket_client_connect_to_service" g_socket_client_connect_to_service :: Ptr SocketClient -> -- client : TInterface (Name {namespace = "Gio", name = "SocketClient"}) CString -> -- domain : TBasicType TUTF8 CString -> -- service : TBasicType TUTF8 Ptr Gio.Cancellable.Cancellable -> -- cancellable : TInterface (Name {namespace = "Gio", name = "Cancellable"}) Ptr (Ptr GError) -> -- error IO (Ptr Gio.SocketConnection.SocketConnection) {- | Attempts to create a TCP connection to a service. This call looks up the SRV record for /@service@/ at /@domain@/ for the \"tcp\" protocol. It then attempts to connect, in turn, to each of the hosts providing the service until either a connection succeeds or there are no hosts remaining. Upon a successful connection, a new 'GI.Gio.Objects.SocketConnection.SocketConnection' is constructed and returned. The caller owns this new object and must drop their reference to it when finished with it. In the event of any failure (DNS error, service not found, no hosts connectable) 'Nothing' is returned and /@error@/ (if non-'Nothing') is set accordingly. -} socketClientConnectToService :: (B.CallStack.HasCallStack, MonadIO m, IsSocketClient a, Gio.Cancellable.IsCancellable b) => a {- ^ /@client@/: a 'GI.Gio.Objects.SocketConnection.SocketConnection' -} -> T.Text {- ^ /@domain@/: a domain name -} -> T.Text {- ^ /@service@/: the name of the service to connect to -} -> Maybe (b) {- ^ /@cancellable@/: a 'GI.Gio.Objects.Cancellable.Cancellable', or 'Nothing' -} -> m Gio.SocketConnection.SocketConnection {- ^ __Returns:__ a 'GI.Gio.Objects.SocketConnection.SocketConnection' if successful, or 'Nothing' on error /(Can throw 'Data.GI.Base.GError.GError')/ -} socketClientConnectToService client domain service cancellable = liftIO $ do client' <- unsafeManagedPtrCastPtr client domain' <- textToCString domain service' <- textToCString service maybeCancellable <- case cancellable of Nothing -> return nullPtr Just jCancellable -> do jCancellable' <- unsafeManagedPtrCastPtr jCancellable return jCancellable' onException (do result <- propagateGError $ g_socket_client_connect_to_service client' domain' service' maybeCancellable checkUnexpectedReturnNULL "socketClientConnectToService" result result' <- (wrapObject Gio.SocketConnection.SocketConnection) result touchManagedPtr client whenJust cancellable touchManagedPtr freeMem domain' freeMem service' return result' ) (do freeMem domain' freeMem service' ) data SocketClientConnectToServiceMethodInfo instance (signature ~ (T.Text -> T.Text -> Maybe (b) -> m Gio.SocketConnection.SocketConnection), MonadIO m, IsSocketClient a, Gio.Cancellable.IsCancellable b) => O.MethodInfo SocketClientConnectToServiceMethodInfo a signature where overloadedMethod _ = socketClientConnectToService -- method SocketClient::connect_to_service_async -- method type : OrdinaryMethod -- Args : [Arg {argCName = "client", argType = TInterface (Name {namespace = "Gio", name = "SocketClient"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GSocketClient", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "domain", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a domain name", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "service", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the name of the service to connect to", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "cancellable", argType = TInterface (Name {namespace = "Gio", name = "Cancellable"}), direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "a #GCancellable, or %NULL", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "callback", argType = TInterface (Name {namespace = "Gio", name = "AsyncReadyCallback"}), direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "a #GAsyncReadyCallback", sinceVersion = Nothing}, argScope = ScopeTypeAsync, argClosure = 5, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "user_data", argType = TBasicType TPtr, direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "user data for the callback", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}] -- Lengths : [] -- returnType : Nothing -- throws : False -- Skip return : False foreign import ccall "g_socket_client_connect_to_service_async" g_socket_client_connect_to_service_async :: Ptr SocketClient -> -- client : TInterface (Name {namespace = "Gio", name = "SocketClient"}) CString -> -- domain : TBasicType TUTF8 CString -> -- service : TBasicType TUTF8 Ptr Gio.Cancellable.Cancellable -> -- cancellable : TInterface (Name {namespace = "Gio", name = "Cancellable"}) FunPtr Gio.Callbacks.C_AsyncReadyCallback -> -- callback : TInterface (Name {namespace = "Gio", name = "AsyncReadyCallback"}) Ptr () -> -- user_data : TBasicType TPtr IO () {- | This is the asynchronous version of 'GI.Gio.Objects.SocketClient.socketClientConnectToService'. @since 2.22 -} socketClientConnectToServiceAsync :: (B.CallStack.HasCallStack, MonadIO m, IsSocketClient a, Gio.Cancellable.IsCancellable b) => a {- ^ /@client@/: a 'GI.Gio.Objects.SocketClient.SocketClient' -} -> T.Text {- ^ /@domain@/: a domain name -} -> T.Text {- ^ /@service@/: the name of the service to connect to -} -> Maybe (b) {- ^ /@cancellable@/: a 'GI.Gio.Objects.Cancellable.Cancellable', or 'Nothing' -} -> Maybe (Gio.Callbacks.AsyncReadyCallback) {- ^ /@callback@/: a 'GI.Gio.Callbacks.AsyncReadyCallback' -} -> m () socketClientConnectToServiceAsync client domain service cancellable callback = liftIO $ do client' <- unsafeManagedPtrCastPtr client domain' <- textToCString domain service' <- textToCString service maybeCancellable <- case cancellable of Nothing -> return nullPtr Just jCancellable -> do jCancellable' <- unsafeManagedPtrCastPtr jCancellable return jCancellable' ptrcallback <- callocMem :: IO (Ptr (FunPtr Gio.Callbacks.C_AsyncReadyCallback)) maybeCallback <- case callback of Nothing -> return (castPtrToFunPtr nullPtr) Just jCallback -> do jCallback' <- Gio.Callbacks.mk_AsyncReadyCallback (Gio.Callbacks.wrap_AsyncReadyCallback (Just ptrcallback) (Gio.Callbacks.drop_closures_AsyncReadyCallback jCallback)) poke ptrcallback jCallback' return jCallback' let userData = nullPtr g_socket_client_connect_to_service_async client' domain' service' maybeCancellable maybeCallback userData touchManagedPtr client whenJust cancellable touchManagedPtr freeMem domain' freeMem service' return () data SocketClientConnectToServiceAsyncMethodInfo instance (signature ~ (T.Text -> T.Text -> Maybe (b) -> Maybe (Gio.Callbacks.AsyncReadyCallback) -> m ()), MonadIO m, IsSocketClient a, Gio.Cancellable.IsCancellable b) => O.MethodInfo SocketClientConnectToServiceAsyncMethodInfo a signature where overloadedMethod _ = socketClientConnectToServiceAsync -- method SocketClient::connect_to_service_finish -- method type : OrdinaryMethod -- Args : [Arg {argCName = "client", argType = TInterface (Name {namespace = "Gio", name = "SocketClient"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GSocketClient.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "result", argType = TInterface (Name {namespace = "Gio", name = "AsyncResult"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GAsyncResult.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}] -- Lengths : [] -- returnType : Just (TInterface (Name {namespace = "Gio", name = "SocketConnection"})) -- throws : True -- Skip return : False foreign import ccall "g_socket_client_connect_to_service_finish" g_socket_client_connect_to_service_finish :: Ptr SocketClient -> -- client : TInterface (Name {namespace = "Gio", name = "SocketClient"}) Ptr Gio.AsyncResult.AsyncResult -> -- result : TInterface (Name {namespace = "Gio", name = "AsyncResult"}) Ptr (Ptr GError) -> -- error IO (Ptr Gio.SocketConnection.SocketConnection) {- | Finishes an async connect operation. See 'GI.Gio.Objects.SocketClient.socketClientConnectToServiceAsync' @since 2.22 -} socketClientConnectToServiceFinish :: (B.CallStack.HasCallStack, MonadIO m, IsSocketClient a, Gio.AsyncResult.IsAsyncResult b) => a {- ^ /@client@/: a 'GI.Gio.Objects.SocketClient.SocketClient'. -} -> b {- ^ /@result@/: a 'GI.Gio.Interfaces.AsyncResult.AsyncResult'. -} -> m Gio.SocketConnection.SocketConnection {- ^ __Returns:__ a 'GI.Gio.Objects.SocketConnection.SocketConnection' on success, 'Nothing' on error. /(Can throw 'Data.GI.Base.GError.GError')/ -} socketClientConnectToServiceFinish client result_ = liftIO $ do client' <- unsafeManagedPtrCastPtr client result_' <- unsafeManagedPtrCastPtr result_ onException (do result <- propagateGError $ g_socket_client_connect_to_service_finish client' result_' checkUnexpectedReturnNULL "socketClientConnectToServiceFinish" result result' <- (wrapObject Gio.SocketConnection.SocketConnection) result touchManagedPtr client touchManagedPtr result_ return result' ) (do return () ) data SocketClientConnectToServiceFinishMethodInfo instance (signature ~ (b -> m Gio.SocketConnection.SocketConnection), MonadIO m, IsSocketClient a, Gio.AsyncResult.IsAsyncResult b) => O.MethodInfo SocketClientConnectToServiceFinishMethodInfo a signature where overloadedMethod _ = socketClientConnectToServiceFinish -- method SocketClient::connect_to_uri -- method type : OrdinaryMethod -- Args : [Arg {argCName = "client", argType = TInterface (Name {namespace = "Gio", name = "SocketClient"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GSocketClient", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "uri", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "A network URI", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "default_port", argType = TBasicType TUInt16, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the default port to connect to", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "cancellable", argType = TInterface (Name {namespace = "Gio", name = "Cancellable"}), direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "a #GCancellable, or %NULL", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}] -- Lengths : [] -- returnType : Just (TInterface (Name {namespace = "Gio", name = "SocketConnection"})) -- throws : True -- Skip return : False foreign import ccall "g_socket_client_connect_to_uri" g_socket_client_connect_to_uri :: Ptr SocketClient -> -- client : TInterface (Name {namespace = "Gio", name = "SocketClient"}) CString -> -- uri : TBasicType TUTF8 Word16 -> -- default_port : TBasicType TUInt16 Ptr Gio.Cancellable.Cancellable -> -- cancellable : TInterface (Name {namespace = "Gio", name = "Cancellable"}) Ptr (Ptr GError) -> -- error IO (Ptr Gio.SocketConnection.SocketConnection) {- | This is a helper function for 'GI.Gio.Objects.SocketClient.socketClientConnect'. Attempts to create a TCP connection with a network URI. /@uri@/ may be any valid URI containing an \"authority\" (hostname\/port) component. If a port is not specified in the URI, /@defaultPort@/ will be used. TLS will be negotiated if 'GI.Gio.Objects.SocketClient.SocketClient':@/tls/@ is 'True'. ('GI.Gio.Objects.SocketClient.SocketClient' does not know to automatically assume TLS for certain URI schemes.) Using this rather than 'GI.Gio.Objects.SocketClient.socketClientConnect' or 'GI.Gio.Objects.SocketClient.socketClientConnectToHost' allows 'GI.Gio.Objects.SocketClient.SocketClient' to determine when to use application-specific proxy protocols. Upon a successful connection, a new 'GI.Gio.Objects.SocketConnection.SocketConnection' is constructed and returned. The caller owns this new object and must drop their reference to it when finished with it. In the event of any failure (DNS error, service not found, no hosts connectable) 'Nothing' is returned and /@error@/ (if non-'Nothing') is set accordingly. @since 2.26 -} socketClientConnectToUri :: (B.CallStack.HasCallStack, MonadIO m, IsSocketClient a, Gio.Cancellable.IsCancellable b) => a {- ^ /@client@/: a 'GI.Gio.Objects.SocketClient.SocketClient' -} -> T.Text {- ^ /@uri@/: A network URI -} -> Word16 {- ^ /@defaultPort@/: the default port to connect to -} -> Maybe (b) {- ^ /@cancellable@/: a 'GI.Gio.Objects.Cancellable.Cancellable', or 'Nothing' -} -> m Gio.SocketConnection.SocketConnection {- ^ __Returns:__ a 'GI.Gio.Objects.SocketConnection.SocketConnection' on success, 'Nothing' on error. /(Can throw 'Data.GI.Base.GError.GError')/ -} socketClientConnectToUri client uri defaultPort cancellable = liftIO $ do client' <- unsafeManagedPtrCastPtr client uri' <- textToCString uri maybeCancellable <- case cancellable of Nothing -> return nullPtr Just jCancellable -> do jCancellable' <- unsafeManagedPtrCastPtr jCancellable return jCancellable' onException (do result <- propagateGError $ g_socket_client_connect_to_uri client' uri' defaultPort maybeCancellable checkUnexpectedReturnNULL "socketClientConnectToUri" result result' <- (wrapObject Gio.SocketConnection.SocketConnection) result touchManagedPtr client whenJust cancellable touchManagedPtr freeMem uri' return result' ) (do freeMem uri' ) data SocketClientConnectToUriMethodInfo instance (signature ~ (T.Text -> Word16 -> Maybe (b) -> m Gio.SocketConnection.SocketConnection), MonadIO m, IsSocketClient a, Gio.Cancellable.IsCancellable b) => O.MethodInfo SocketClientConnectToUriMethodInfo a signature where overloadedMethod _ = socketClientConnectToUri -- method SocketClient::connect_to_uri_async -- method type : OrdinaryMethod -- Args : [Arg {argCName = "client", argType = TInterface (Name {namespace = "Gio", name = "SocketClient"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GSocketClient", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "uri", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a network uri", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "default_port", argType = TBasicType TUInt16, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the default port to connect to", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "cancellable", argType = TInterface (Name {namespace = "Gio", name = "Cancellable"}), direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "a #GCancellable, or %NULL", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "callback", argType = TInterface (Name {namespace = "Gio", name = "AsyncReadyCallback"}), direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "a #GAsyncReadyCallback", sinceVersion = Nothing}, argScope = ScopeTypeAsync, argClosure = 5, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "user_data", argType = TBasicType TPtr, direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "user data for the callback", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}] -- Lengths : [] -- returnType : Nothing -- throws : False -- Skip return : False foreign import ccall "g_socket_client_connect_to_uri_async" g_socket_client_connect_to_uri_async :: Ptr SocketClient -> -- client : TInterface (Name {namespace = "Gio", name = "SocketClient"}) CString -> -- uri : TBasicType TUTF8 Word16 -> -- default_port : TBasicType TUInt16 Ptr Gio.Cancellable.Cancellable -> -- cancellable : TInterface (Name {namespace = "Gio", name = "Cancellable"}) FunPtr Gio.Callbacks.C_AsyncReadyCallback -> -- callback : TInterface (Name {namespace = "Gio", name = "AsyncReadyCallback"}) Ptr () -> -- user_data : TBasicType TPtr IO () {- | This is the asynchronous version of 'GI.Gio.Objects.SocketClient.socketClientConnectToUri'. When the operation is finished /@callback@/ will be called. You can then call 'GI.Gio.Objects.SocketClient.socketClientConnectToUriFinish' to get the result of the operation. @since 2.26 -} socketClientConnectToUriAsync :: (B.CallStack.HasCallStack, MonadIO m, IsSocketClient a, Gio.Cancellable.IsCancellable b) => a {- ^ /@client@/: a 'GI.Gio.Objects.SocketClient.SocketClient' -} -> T.Text {- ^ /@uri@/: a network uri -} -> Word16 {- ^ /@defaultPort@/: the default port to connect to -} -> Maybe (b) {- ^ /@cancellable@/: a 'GI.Gio.Objects.Cancellable.Cancellable', or 'Nothing' -} -> Maybe (Gio.Callbacks.AsyncReadyCallback) {- ^ /@callback@/: a 'GI.Gio.Callbacks.AsyncReadyCallback' -} -> m () socketClientConnectToUriAsync client uri defaultPort cancellable callback = liftIO $ do client' <- unsafeManagedPtrCastPtr client uri' <- textToCString uri maybeCancellable <- case cancellable of Nothing -> return nullPtr Just jCancellable -> do jCancellable' <- unsafeManagedPtrCastPtr jCancellable return jCancellable' ptrcallback <- callocMem :: IO (Ptr (FunPtr Gio.Callbacks.C_AsyncReadyCallback)) maybeCallback <- case callback of Nothing -> return (castPtrToFunPtr nullPtr) Just jCallback -> do jCallback' <- Gio.Callbacks.mk_AsyncReadyCallback (Gio.Callbacks.wrap_AsyncReadyCallback (Just ptrcallback) (Gio.Callbacks.drop_closures_AsyncReadyCallback jCallback)) poke ptrcallback jCallback' return jCallback' let userData = nullPtr g_socket_client_connect_to_uri_async client' uri' defaultPort maybeCancellable maybeCallback userData touchManagedPtr client whenJust cancellable touchManagedPtr freeMem uri' return () data SocketClientConnectToUriAsyncMethodInfo instance (signature ~ (T.Text -> Word16 -> Maybe (b) -> Maybe (Gio.Callbacks.AsyncReadyCallback) -> m ()), MonadIO m, IsSocketClient a, Gio.Cancellable.IsCancellable b) => O.MethodInfo SocketClientConnectToUriAsyncMethodInfo a signature where overloadedMethod _ = socketClientConnectToUriAsync -- method SocketClient::connect_to_uri_finish -- method type : OrdinaryMethod -- Args : [Arg {argCName = "client", argType = TInterface (Name {namespace = "Gio", name = "SocketClient"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GSocketClient.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "result", argType = TInterface (Name {namespace = "Gio", name = "AsyncResult"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GAsyncResult.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}] -- Lengths : [] -- returnType : Just (TInterface (Name {namespace = "Gio", name = "SocketConnection"})) -- throws : True -- Skip return : False foreign import ccall "g_socket_client_connect_to_uri_finish" g_socket_client_connect_to_uri_finish :: Ptr SocketClient -> -- client : TInterface (Name {namespace = "Gio", name = "SocketClient"}) Ptr Gio.AsyncResult.AsyncResult -> -- result : TInterface (Name {namespace = "Gio", name = "AsyncResult"}) Ptr (Ptr GError) -> -- error IO (Ptr Gio.SocketConnection.SocketConnection) {- | Finishes an async connect operation. See 'GI.Gio.Objects.SocketClient.socketClientConnectToUriAsync' @since 2.26 -} socketClientConnectToUriFinish :: (B.CallStack.HasCallStack, MonadIO m, IsSocketClient a, Gio.AsyncResult.IsAsyncResult b) => a {- ^ /@client@/: a 'GI.Gio.Objects.SocketClient.SocketClient'. -} -> b {- ^ /@result@/: a 'GI.Gio.Interfaces.AsyncResult.AsyncResult'. -} -> m Gio.SocketConnection.SocketConnection {- ^ __Returns:__ a 'GI.Gio.Objects.SocketConnection.SocketConnection' on success, 'Nothing' on error. /(Can throw 'Data.GI.Base.GError.GError')/ -} socketClientConnectToUriFinish client result_ = liftIO $ do client' <- unsafeManagedPtrCastPtr client result_' <- unsafeManagedPtrCastPtr result_ onException (do result <- propagateGError $ g_socket_client_connect_to_uri_finish client' result_' checkUnexpectedReturnNULL "socketClientConnectToUriFinish" result result' <- (wrapObject Gio.SocketConnection.SocketConnection) result touchManagedPtr client touchManagedPtr result_ return result' ) (do return () ) data SocketClientConnectToUriFinishMethodInfo instance (signature ~ (b -> m Gio.SocketConnection.SocketConnection), MonadIO m, IsSocketClient a, Gio.AsyncResult.IsAsyncResult b) => O.MethodInfo SocketClientConnectToUriFinishMethodInfo a signature where overloadedMethod _ = socketClientConnectToUriFinish -- method SocketClient::get_enable_proxy -- method type : OrdinaryMethod -- Args : [Arg {argCName = "client", argType = TInterface (Name {namespace = "Gio", name = "SocketClient"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GSocketClient.", 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_socket_client_get_enable_proxy" g_socket_client_get_enable_proxy :: Ptr SocketClient -> -- client : TInterface (Name {namespace = "Gio", name = "SocketClient"}) IO CInt {- | Gets the proxy enable state; see 'GI.Gio.Objects.SocketClient.socketClientSetEnableProxy' @since 2.26 -} socketClientGetEnableProxy :: (B.CallStack.HasCallStack, MonadIO m, IsSocketClient a) => a {- ^ /@client@/: a 'GI.Gio.Objects.SocketClient.SocketClient'. -} -> m Bool {- ^ __Returns:__ whether proxying is enabled -} socketClientGetEnableProxy client = liftIO $ do client' <- unsafeManagedPtrCastPtr client result <- g_socket_client_get_enable_proxy client' let result' = (/= 0) result touchManagedPtr client return result' data SocketClientGetEnableProxyMethodInfo instance (signature ~ (m Bool), MonadIO m, IsSocketClient a) => O.MethodInfo SocketClientGetEnableProxyMethodInfo a signature where overloadedMethod _ = socketClientGetEnableProxy -- method SocketClient::get_family -- method type : OrdinaryMethod -- Args : [Arg {argCName = "client", argType = TInterface (Name {namespace = "Gio", name = "SocketClient"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GSocketClient.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}] -- Lengths : [] -- returnType : Just (TInterface (Name {namespace = "Gio", name = "SocketFamily"})) -- throws : False -- Skip return : False foreign import ccall "g_socket_client_get_family" g_socket_client_get_family :: Ptr SocketClient -> -- client : TInterface (Name {namespace = "Gio", name = "SocketClient"}) IO CUInt {- | Gets the socket family of the socket client. See 'GI.Gio.Objects.SocketClient.socketClientSetFamily' for details. @since 2.22 -} socketClientGetFamily :: (B.CallStack.HasCallStack, MonadIO m, IsSocketClient a) => a {- ^ /@client@/: a 'GI.Gio.Objects.SocketClient.SocketClient'. -} -> m Gio.Enums.SocketFamily {- ^ __Returns:__ a 'GI.Gio.Enums.SocketFamily' -} socketClientGetFamily client = liftIO $ do client' <- unsafeManagedPtrCastPtr client result <- g_socket_client_get_family client' let result' = (toEnum . fromIntegral) result touchManagedPtr client return result' data SocketClientGetFamilyMethodInfo instance (signature ~ (m Gio.Enums.SocketFamily), MonadIO m, IsSocketClient a) => O.MethodInfo SocketClientGetFamilyMethodInfo a signature where overloadedMethod _ = socketClientGetFamily -- method SocketClient::get_local_address -- method type : OrdinaryMethod -- Args : [Arg {argCName = "client", argType = TInterface (Name {namespace = "Gio", name = "SocketClient"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GSocketClient.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}] -- Lengths : [] -- returnType : Just (TInterface (Name {namespace = "Gio", name = "SocketAddress"})) -- throws : False -- Skip return : False foreign import ccall "g_socket_client_get_local_address" g_socket_client_get_local_address :: Ptr SocketClient -> -- client : TInterface (Name {namespace = "Gio", name = "SocketClient"}) IO (Ptr Gio.SocketAddress.SocketAddress) {- | Gets the local address of the socket client. See 'GI.Gio.Objects.SocketClient.socketClientSetLocalAddress' for details. @since 2.22 -} socketClientGetLocalAddress :: (B.CallStack.HasCallStack, MonadIO m, IsSocketClient a) => a {- ^ /@client@/: a 'GI.Gio.Objects.SocketClient.SocketClient'. -} -> m Gio.SocketAddress.SocketAddress {- ^ __Returns:__ a 'GI.Gio.Objects.SocketAddress.SocketAddress' or 'Nothing'. Do not free. -} socketClientGetLocalAddress client = liftIO $ do client' <- unsafeManagedPtrCastPtr client result <- g_socket_client_get_local_address client' checkUnexpectedReturnNULL "socketClientGetLocalAddress" result result' <- (newObject Gio.SocketAddress.SocketAddress) result touchManagedPtr client return result' data SocketClientGetLocalAddressMethodInfo instance (signature ~ (m Gio.SocketAddress.SocketAddress), MonadIO m, IsSocketClient a) => O.MethodInfo SocketClientGetLocalAddressMethodInfo a signature where overloadedMethod _ = socketClientGetLocalAddress -- method SocketClient::get_protocol -- method type : OrdinaryMethod -- Args : [Arg {argCName = "client", argType = TInterface (Name {namespace = "Gio", name = "SocketClient"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GSocketClient", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}] -- Lengths : [] -- returnType : Just (TInterface (Name {namespace = "Gio", name = "SocketProtocol"})) -- throws : False -- Skip return : False foreign import ccall "g_socket_client_get_protocol" g_socket_client_get_protocol :: Ptr SocketClient -> -- client : TInterface (Name {namespace = "Gio", name = "SocketClient"}) IO CUInt {- | Gets the protocol name type of the socket client. See 'GI.Gio.Objects.SocketClient.socketClientSetProtocol' for details. @since 2.22 -} socketClientGetProtocol :: (B.CallStack.HasCallStack, MonadIO m, IsSocketClient a) => a {- ^ /@client@/: a 'GI.Gio.Objects.SocketClient.SocketClient' -} -> m Gio.Enums.SocketProtocol {- ^ __Returns:__ a 'GI.Gio.Enums.SocketProtocol' -} socketClientGetProtocol client = liftIO $ do client' <- unsafeManagedPtrCastPtr client result <- g_socket_client_get_protocol client' let result' = (toEnum . fromIntegral) result touchManagedPtr client return result' data SocketClientGetProtocolMethodInfo instance (signature ~ (m Gio.Enums.SocketProtocol), MonadIO m, IsSocketClient a) => O.MethodInfo SocketClientGetProtocolMethodInfo a signature where overloadedMethod _ = socketClientGetProtocol -- method SocketClient::get_proxy_resolver -- method type : OrdinaryMethod -- Args : [Arg {argCName = "client", argType = TInterface (Name {namespace = "Gio", name = "SocketClient"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GSocketClient.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}] -- Lengths : [] -- returnType : Just (TInterface (Name {namespace = "Gio", name = "ProxyResolver"})) -- throws : False -- Skip return : False foreign import ccall "g_socket_client_get_proxy_resolver" g_socket_client_get_proxy_resolver :: Ptr SocketClient -> -- client : TInterface (Name {namespace = "Gio", name = "SocketClient"}) IO (Ptr Gio.ProxyResolver.ProxyResolver) {- | Gets the 'GI.Gio.Interfaces.ProxyResolver.ProxyResolver' being used by /@client@/. Normally, this will be the resolver returned by 'GI.Gio.Functions.proxyResolverGetDefault', but you can override it with 'GI.Gio.Objects.SocketClient.socketClientSetProxyResolver'. @since 2.36 -} socketClientGetProxyResolver :: (B.CallStack.HasCallStack, MonadIO m, IsSocketClient a) => a {- ^ /@client@/: a 'GI.Gio.Objects.SocketClient.SocketClient'. -} -> m Gio.ProxyResolver.ProxyResolver {- ^ __Returns:__ The 'GI.Gio.Interfaces.ProxyResolver.ProxyResolver' being used by /@client@/. -} socketClientGetProxyResolver client = liftIO $ do client' <- unsafeManagedPtrCastPtr client result <- g_socket_client_get_proxy_resolver client' checkUnexpectedReturnNULL "socketClientGetProxyResolver" result result' <- (newObject Gio.ProxyResolver.ProxyResolver) result touchManagedPtr client return result' data SocketClientGetProxyResolverMethodInfo instance (signature ~ (m Gio.ProxyResolver.ProxyResolver), MonadIO m, IsSocketClient a) => O.MethodInfo SocketClientGetProxyResolverMethodInfo a signature where overloadedMethod _ = socketClientGetProxyResolver -- method SocketClient::get_socket_type -- method type : OrdinaryMethod -- Args : [Arg {argCName = "client", argType = TInterface (Name {namespace = "Gio", name = "SocketClient"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GSocketClient.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}] -- Lengths : [] -- returnType : Just (TInterface (Name {namespace = "Gio", name = "SocketType"})) -- throws : False -- Skip return : False foreign import ccall "g_socket_client_get_socket_type" g_socket_client_get_socket_type :: Ptr SocketClient -> -- client : TInterface (Name {namespace = "Gio", name = "SocketClient"}) IO CUInt {- | Gets the socket type of the socket client. See 'GI.Gio.Objects.SocketClient.socketClientSetSocketType' for details. @since 2.22 -} socketClientGetSocketType :: (B.CallStack.HasCallStack, MonadIO m, IsSocketClient a) => a {- ^ /@client@/: a 'GI.Gio.Objects.SocketClient.SocketClient'. -} -> m Gio.Enums.SocketType {- ^ __Returns:__ a 'GI.Gio.Enums.SocketFamily' -} socketClientGetSocketType client = liftIO $ do client' <- unsafeManagedPtrCastPtr client result <- g_socket_client_get_socket_type client' let result' = (toEnum . fromIntegral) result touchManagedPtr client return result' data SocketClientGetSocketTypeMethodInfo instance (signature ~ (m Gio.Enums.SocketType), MonadIO m, IsSocketClient a) => O.MethodInfo SocketClientGetSocketTypeMethodInfo a signature where overloadedMethod _ = socketClientGetSocketType -- method SocketClient::get_timeout -- method type : OrdinaryMethod -- Args : [Arg {argCName = "client", argType = TInterface (Name {namespace = "Gio", name = "SocketClient"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GSocketClient", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}] -- Lengths : [] -- returnType : Just (TBasicType TUInt) -- throws : False -- Skip return : False foreign import ccall "g_socket_client_get_timeout" g_socket_client_get_timeout :: Ptr SocketClient -> -- client : TInterface (Name {namespace = "Gio", name = "SocketClient"}) IO Word32 {- | Gets the I\/O timeout time for sockets created by /@client@/. See 'GI.Gio.Objects.SocketClient.socketClientSetTimeout' for details. @since 2.26 -} socketClientGetTimeout :: (B.CallStack.HasCallStack, MonadIO m, IsSocketClient a) => a {- ^ /@client@/: a 'GI.Gio.Objects.SocketClient.SocketClient' -} -> m Word32 {- ^ __Returns:__ the timeout in seconds -} socketClientGetTimeout client = liftIO $ do client' <- unsafeManagedPtrCastPtr client result <- g_socket_client_get_timeout client' touchManagedPtr client return result data SocketClientGetTimeoutMethodInfo instance (signature ~ (m Word32), MonadIO m, IsSocketClient a) => O.MethodInfo SocketClientGetTimeoutMethodInfo a signature where overloadedMethod _ = socketClientGetTimeout -- method SocketClient::get_tls -- method type : OrdinaryMethod -- Args : [Arg {argCName = "client", argType = TInterface (Name {namespace = "Gio", name = "SocketClient"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GSocketClient.", 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_socket_client_get_tls" g_socket_client_get_tls :: Ptr SocketClient -> -- client : TInterface (Name {namespace = "Gio", name = "SocketClient"}) IO CInt {- | Gets whether /@client@/ creates TLS connections. See 'GI.Gio.Objects.SocketClient.socketClientSetTls' for details. @since 2.28 -} socketClientGetTls :: (B.CallStack.HasCallStack, MonadIO m, IsSocketClient a) => a {- ^ /@client@/: a 'GI.Gio.Objects.SocketClient.SocketClient'. -} -> m Bool {- ^ __Returns:__ whether /@client@/ uses TLS -} socketClientGetTls client = liftIO $ do client' <- unsafeManagedPtrCastPtr client result <- g_socket_client_get_tls client' let result' = (/= 0) result touchManagedPtr client return result' data SocketClientGetTlsMethodInfo instance (signature ~ (m Bool), MonadIO m, IsSocketClient a) => O.MethodInfo SocketClientGetTlsMethodInfo a signature where overloadedMethod _ = socketClientGetTls -- method SocketClient::get_tls_validation_flags -- method type : OrdinaryMethod -- Args : [Arg {argCName = "client", argType = TInterface (Name {namespace = "Gio", name = "SocketClient"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GSocketClient.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}] -- Lengths : [] -- returnType : Just (TInterface (Name {namespace = "Gio", name = "TlsCertificateFlags"})) -- throws : False -- Skip return : False foreign import ccall "g_socket_client_get_tls_validation_flags" g_socket_client_get_tls_validation_flags :: Ptr SocketClient -> -- client : TInterface (Name {namespace = "Gio", name = "SocketClient"}) IO CUInt {- | Gets the TLS validation flags used creating TLS connections via /@client@/. @since 2.28 -} socketClientGetTlsValidationFlags :: (B.CallStack.HasCallStack, MonadIO m, IsSocketClient a) => a {- ^ /@client@/: a 'GI.Gio.Objects.SocketClient.SocketClient'. -} -> m [Gio.Flags.TlsCertificateFlags] {- ^ __Returns:__ the TLS validation flags -} socketClientGetTlsValidationFlags client = liftIO $ do client' <- unsafeManagedPtrCastPtr client result <- g_socket_client_get_tls_validation_flags client' let result' = wordToGFlags result touchManagedPtr client return result' data SocketClientGetTlsValidationFlagsMethodInfo instance (signature ~ (m [Gio.Flags.TlsCertificateFlags]), MonadIO m, IsSocketClient a) => O.MethodInfo SocketClientGetTlsValidationFlagsMethodInfo a signature where overloadedMethod _ = socketClientGetTlsValidationFlags -- method SocketClient::set_enable_proxy -- method type : OrdinaryMethod -- Args : [Arg {argCName = "client", argType = TInterface (Name {namespace = "Gio", name = "SocketClient"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GSocketClient.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "enable", argType = TBasicType TBoolean, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "whether to enable proxies", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}] -- Lengths : [] -- returnType : Nothing -- throws : False -- Skip return : False foreign import ccall "g_socket_client_set_enable_proxy" g_socket_client_set_enable_proxy :: Ptr SocketClient -> -- client : TInterface (Name {namespace = "Gio", name = "SocketClient"}) CInt -> -- enable : TBasicType TBoolean IO () {- | Sets whether or not /@client@/ attempts to make connections via a proxy server. When enabled (the default), 'GI.Gio.Objects.SocketClient.SocketClient' will use a 'GI.Gio.Interfaces.ProxyResolver.ProxyResolver' to determine if a proxy protocol such as SOCKS is needed, and automatically do the necessary proxy negotiation. See also 'GI.Gio.Objects.SocketClient.socketClientSetProxyResolver'. @since 2.26 -} socketClientSetEnableProxy :: (B.CallStack.HasCallStack, MonadIO m, IsSocketClient a) => a {- ^ /@client@/: a 'GI.Gio.Objects.SocketClient.SocketClient'. -} -> Bool {- ^ /@enable@/: whether to enable proxies -} -> m () socketClientSetEnableProxy client enable = liftIO $ do client' <- unsafeManagedPtrCastPtr client let enable' = (fromIntegral . fromEnum) enable g_socket_client_set_enable_proxy client' enable' touchManagedPtr client return () data SocketClientSetEnableProxyMethodInfo instance (signature ~ (Bool -> m ()), MonadIO m, IsSocketClient a) => O.MethodInfo SocketClientSetEnableProxyMethodInfo a signature where overloadedMethod _ = socketClientSetEnableProxy -- method SocketClient::set_family -- method type : OrdinaryMethod -- Args : [Arg {argCName = "client", argType = TInterface (Name {namespace = "Gio", name = "SocketClient"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GSocketClient.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "family", argType = TInterface (Name {namespace = "Gio", name = "SocketFamily"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GSocketFamily", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}] -- Lengths : [] -- returnType : Nothing -- throws : False -- Skip return : False foreign import ccall "g_socket_client_set_family" g_socket_client_set_family :: Ptr SocketClient -> -- client : TInterface (Name {namespace = "Gio", name = "SocketClient"}) CUInt -> -- family : TInterface (Name {namespace = "Gio", name = "SocketFamily"}) IO () {- | Sets the socket family of the socket client. If this is set to something other than 'GI.Gio.Enums.SocketFamilyInvalid' then the sockets created by this object will be of the specified family. This might be useful for instance if you want to force the local connection to be an ipv4 socket, even though the address might be an ipv6 mapped to ipv4 address. @since 2.22 -} socketClientSetFamily :: (B.CallStack.HasCallStack, MonadIO m, IsSocketClient a) => a {- ^ /@client@/: a 'GI.Gio.Objects.SocketClient.SocketClient'. -} -> Gio.Enums.SocketFamily {- ^ /@family@/: a 'GI.Gio.Enums.SocketFamily' -} -> m () socketClientSetFamily client family = liftIO $ do client' <- unsafeManagedPtrCastPtr client let family' = (fromIntegral . fromEnum) family g_socket_client_set_family client' family' touchManagedPtr client return () data SocketClientSetFamilyMethodInfo instance (signature ~ (Gio.Enums.SocketFamily -> m ()), MonadIO m, IsSocketClient a) => O.MethodInfo SocketClientSetFamilyMethodInfo a signature where overloadedMethod _ = socketClientSetFamily -- method SocketClient::set_local_address -- method type : OrdinaryMethod -- Args : [Arg {argCName = "client", argType = TInterface (Name {namespace = "Gio", name = "SocketClient"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GSocketClient.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "address", argType = TInterface (Name {namespace = "Gio", name = "SocketAddress"}), direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "a #GSocketAddress, or %NULL", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}] -- Lengths : [] -- returnType : Nothing -- throws : False -- Skip return : False foreign import ccall "g_socket_client_set_local_address" g_socket_client_set_local_address :: Ptr SocketClient -> -- client : TInterface (Name {namespace = "Gio", name = "SocketClient"}) Ptr Gio.SocketAddress.SocketAddress -> -- address : TInterface (Name {namespace = "Gio", name = "SocketAddress"}) IO () {- | Sets the local address of the socket client. The sockets created by this object will bound to the specified address (if not 'Nothing') before connecting. This is useful if you want to ensure that the local side of the connection is on a specific port, or on a specific interface. @since 2.22 -} socketClientSetLocalAddress :: (B.CallStack.HasCallStack, MonadIO m, IsSocketClient a, Gio.SocketAddress.IsSocketAddress b) => a {- ^ /@client@/: a 'GI.Gio.Objects.SocketClient.SocketClient'. -} -> Maybe (b) {- ^ /@address@/: a 'GI.Gio.Objects.SocketAddress.SocketAddress', or 'Nothing' -} -> m () socketClientSetLocalAddress client address = liftIO $ do client' <- unsafeManagedPtrCastPtr client maybeAddress <- case address of Nothing -> return nullPtr Just jAddress -> do jAddress' <- unsafeManagedPtrCastPtr jAddress return jAddress' g_socket_client_set_local_address client' maybeAddress touchManagedPtr client whenJust address touchManagedPtr return () data SocketClientSetLocalAddressMethodInfo instance (signature ~ (Maybe (b) -> m ()), MonadIO m, IsSocketClient a, Gio.SocketAddress.IsSocketAddress b) => O.MethodInfo SocketClientSetLocalAddressMethodInfo a signature where overloadedMethod _ = socketClientSetLocalAddress -- method SocketClient::set_protocol -- method type : OrdinaryMethod -- Args : [Arg {argCName = "client", argType = TInterface (Name {namespace = "Gio", name = "SocketClient"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GSocketClient.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "protocol", argType = TInterface (Name {namespace = "Gio", name = "SocketProtocol"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GSocketProtocol", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}] -- Lengths : [] -- returnType : Nothing -- throws : False -- Skip return : False foreign import ccall "g_socket_client_set_protocol" g_socket_client_set_protocol :: Ptr SocketClient -> -- client : TInterface (Name {namespace = "Gio", name = "SocketClient"}) CUInt -> -- protocol : TInterface (Name {namespace = "Gio", name = "SocketProtocol"}) IO () {- | Sets the protocol of the socket client. The sockets created by this object will use of the specified protocol. If /@protocol@/ is @/0/@ that means to use the default protocol for the socket family and type. @since 2.22 -} socketClientSetProtocol :: (B.CallStack.HasCallStack, MonadIO m, IsSocketClient a) => a {- ^ /@client@/: a 'GI.Gio.Objects.SocketClient.SocketClient'. -} -> Gio.Enums.SocketProtocol {- ^ /@protocol@/: a 'GI.Gio.Enums.SocketProtocol' -} -> m () socketClientSetProtocol client protocol = liftIO $ do client' <- unsafeManagedPtrCastPtr client let protocol' = (fromIntegral . fromEnum) protocol g_socket_client_set_protocol client' protocol' touchManagedPtr client return () data SocketClientSetProtocolMethodInfo instance (signature ~ (Gio.Enums.SocketProtocol -> m ()), MonadIO m, IsSocketClient a) => O.MethodInfo SocketClientSetProtocolMethodInfo a signature where overloadedMethod _ = socketClientSetProtocol -- method SocketClient::set_proxy_resolver -- method type : OrdinaryMethod -- Args : [Arg {argCName = "client", argType = TInterface (Name {namespace = "Gio", name = "SocketClient"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GSocketClient.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "proxy_resolver", argType = TInterface (Name {namespace = "Gio", name = "ProxyResolver"}), direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "a #GProxyResolver, or %NULL for the\n default.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}] -- Lengths : [] -- returnType : Nothing -- throws : False -- Skip return : False foreign import ccall "g_socket_client_set_proxy_resolver" g_socket_client_set_proxy_resolver :: Ptr SocketClient -> -- client : TInterface (Name {namespace = "Gio", name = "SocketClient"}) Ptr Gio.ProxyResolver.ProxyResolver -> -- proxy_resolver : TInterface (Name {namespace = "Gio", name = "ProxyResolver"}) IO () {- | Overrides the 'GI.Gio.Interfaces.ProxyResolver.ProxyResolver' used by /@client@/. You can call this if you want to use specific proxies, rather than using the system default proxy settings. Note that whether or not the proxy resolver is actually used depends on the setting of 'GI.Gio.Objects.SocketClient.SocketClient':@/enable-proxy/@, which is not changed by this function (but which is 'True' by default) @since 2.36 -} socketClientSetProxyResolver :: (B.CallStack.HasCallStack, MonadIO m, IsSocketClient a, Gio.ProxyResolver.IsProxyResolver b) => a {- ^ /@client@/: a 'GI.Gio.Objects.SocketClient.SocketClient'. -} -> Maybe (b) {- ^ /@proxyResolver@/: a 'GI.Gio.Interfaces.ProxyResolver.ProxyResolver', or 'Nothing' for the default. -} -> m () socketClientSetProxyResolver client proxyResolver = liftIO $ do client' <- unsafeManagedPtrCastPtr client maybeProxyResolver <- case proxyResolver of Nothing -> return nullPtr Just jProxyResolver -> do jProxyResolver' <- unsafeManagedPtrCastPtr jProxyResolver return jProxyResolver' g_socket_client_set_proxy_resolver client' maybeProxyResolver touchManagedPtr client whenJust proxyResolver touchManagedPtr return () data SocketClientSetProxyResolverMethodInfo instance (signature ~ (Maybe (b) -> m ()), MonadIO m, IsSocketClient a, Gio.ProxyResolver.IsProxyResolver b) => O.MethodInfo SocketClientSetProxyResolverMethodInfo a signature where overloadedMethod _ = socketClientSetProxyResolver -- method SocketClient::set_socket_type -- method type : OrdinaryMethod -- Args : [Arg {argCName = "client", argType = TInterface (Name {namespace = "Gio", name = "SocketClient"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GSocketClient.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "type", argType = TInterface (Name {namespace = "Gio", name = "SocketType"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GSocketType", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}] -- Lengths : [] -- returnType : Nothing -- throws : False -- Skip return : False foreign import ccall "g_socket_client_set_socket_type" g_socket_client_set_socket_type :: Ptr SocketClient -> -- client : TInterface (Name {namespace = "Gio", name = "SocketClient"}) CUInt -> -- type : TInterface (Name {namespace = "Gio", name = "SocketType"}) IO () {- | Sets the socket type of the socket client. The sockets created by this object will be of the specified type. It doesn\'t make sense to specify a type of 'GI.Gio.Enums.SocketTypeDatagram', as GSocketClient is used for connection oriented services. @since 2.22 -} socketClientSetSocketType :: (B.CallStack.HasCallStack, MonadIO m, IsSocketClient a) => a {- ^ /@client@/: a 'GI.Gio.Objects.SocketClient.SocketClient'. -} -> Gio.Enums.SocketType {- ^ /@type@/: a 'GI.Gio.Enums.SocketType' -} -> m () socketClientSetSocketType client type_ = liftIO $ do client' <- unsafeManagedPtrCastPtr client let type_' = (fromIntegral . fromEnum) type_ g_socket_client_set_socket_type client' type_' touchManagedPtr client return () data SocketClientSetSocketTypeMethodInfo instance (signature ~ (Gio.Enums.SocketType -> m ()), MonadIO m, IsSocketClient a) => O.MethodInfo SocketClientSetSocketTypeMethodInfo a signature where overloadedMethod _ = socketClientSetSocketType -- method SocketClient::set_timeout -- method type : OrdinaryMethod -- Args : [Arg {argCName = "client", argType = TInterface (Name {namespace = "Gio", name = "SocketClient"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GSocketClient.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "timeout", argType = TBasicType TUInt, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the timeout", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}] -- Lengths : [] -- returnType : Nothing -- throws : False -- Skip return : False foreign import ccall "g_socket_client_set_timeout" g_socket_client_set_timeout :: Ptr SocketClient -> -- client : TInterface (Name {namespace = "Gio", name = "SocketClient"}) Word32 -> -- timeout : TBasicType TUInt IO () {- | Sets the I\/O timeout for sockets created by /@client@/. /@timeout@/ is a time in seconds, or 0 for no timeout (the default). The timeout value affects the initial connection attempt as well, so setting this may cause calls to 'GI.Gio.Objects.SocketClient.socketClientConnect', etc, to fail with 'GI.Gio.Enums.IOErrorEnumTimedOut'. @since 2.26 -} socketClientSetTimeout :: (B.CallStack.HasCallStack, MonadIO m, IsSocketClient a) => a {- ^ /@client@/: a 'GI.Gio.Objects.SocketClient.SocketClient'. -} -> Word32 {- ^ /@timeout@/: the timeout -} -> m () socketClientSetTimeout client timeout = liftIO $ do client' <- unsafeManagedPtrCastPtr client g_socket_client_set_timeout client' timeout touchManagedPtr client return () data SocketClientSetTimeoutMethodInfo instance (signature ~ (Word32 -> m ()), MonadIO m, IsSocketClient a) => O.MethodInfo SocketClientSetTimeoutMethodInfo a signature where overloadedMethod _ = socketClientSetTimeout -- method SocketClient::set_tls -- method type : OrdinaryMethod -- Args : [Arg {argCName = "client", argType = TInterface (Name {namespace = "Gio", name = "SocketClient"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GSocketClient.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "tls", argType = TBasicType TBoolean, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "whether to use TLS", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}] -- Lengths : [] -- returnType : Nothing -- throws : False -- Skip return : False foreign import ccall "g_socket_client_set_tls" g_socket_client_set_tls :: Ptr SocketClient -> -- client : TInterface (Name {namespace = "Gio", name = "SocketClient"}) CInt -> -- tls : TBasicType TBoolean IO () {- | Sets whether /@client@/ creates TLS (aka SSL) connections. If /@tls@/ is 'True', /@client@/ will wrap its connections in a 'GI.Gio.Interfaces.TlsClientConnection.TlsClientConnection' and perform a TLS handshake when connecting. Note that since 'GI.Gio.Objects.SocketClient.SocketClient' must return a 'GI.Gio.Objects.SocketConnection.SocketConnection', but 'GI.Gio.Interfaces.TlsClientConnection.TlsClientConnection' is not a 'GI.Gio.Objects.SocketConnection.SocketConnection', this actually wraps the resulting 'GI.Gio.Interfaces.TlsClientConnection.TlsClientConnection' in a 'GI.Gio.Objects.TcpWrapperConnection.TcpWrapperConnection' when returning it. You can use 'GI.Gio.Objects.TcpWrapperConnection.tcpWrapperConnectionGetBaseIoStream' on the return value to extract the 'GI.Gio.Interfaces.TlsClientConnection.TlsClientConnection'. If you need to modify the behavior of the TLS handshake (eg, by setting a client-side certificate to use, or connecting to the 'GI.Gio.Objects.TlsConnection.TlsConnection'::@/accept-certificate/@ signal), you can connect to /@client@/\'s 'GI.Gio.Objects.SocketClient.SocketClient'::@/event/@ signal and wait for it to be emitted with 'GI.Gio.Enums.SocketClientEventTlsHandshaking', which will give you a chance to see the 'GI.Gio.Interfaces.TlsClientConnection.TlsClientConnection' before the handshake starts. @since 2.28 -} socketClientSetTls :: (B.CallStack.HasCallStack, MonadIO m, IsSocketClient a) => a {- ^ /@client@/: a 'GI.Gio.Objects.SocketClient.SocketClient'. -} -> Bool {- ^ /@tls@/: whether to use TLS -} -> m () socketClientSetTls client tls = liftIO $ do client' <- unsafeManagedPtrCastPtr client let tls' = (fromIntegral . fromEnum) tls g_socket_client_set_tls client' tls' touchManagedPtr client return () data SocketClientSetTlsMethodInfo instance (signature ~ (Bool -> m ()), MonadIO m, IsSocketClient a) => O.MethodInfo SocketClientSetTlsMethodInfo a signature where overloadedMethod _ = socketClientSetTls -- method SocketClient::set_tls_validation_flags -- method type : OrdinaryMethod -- Args : [Arg {argCName = "client", argType = TInterface (Name {namespace = "Gio", name = "SocketClient"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GSocketClient.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "flags", argType = TInterface (Name {namespace = "Gio", name = "TlsCertificateFlags"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the validation flags", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}] -- Lengths : [] -- returnType : Nothing -- throws : False -- Skip return : False foreign import ccall "g_socket_client_set_tls_validation_flags" g_socket_client_set_tls_validation_flags :: Ptr SocketClient -> -- client : TInterface (Name {namespace = "Gio", name = "SocketClient"}) CUInt -> -- flags : TInterface (Name {namespace = "Gio", name = "TlsCertificateFlags"}) IO () {- | Sets the TLS validation flags used when creating TLS connections via /@client@/. The default value is 'GI.Gio.Flags.TlsCertificateFlagsValidateAll'. @since 2.28 -} socketClientSetTlsValidationFlags :: (B.CallStack.HasCallStack, MonadIO m, IsSocketClient a) => a {- ^ /@client@/: a 'GI.Gio.Objects.SocketClient.SocketClient'. -} -> [Gio.Flags.TlsCertificateFlags] {- ^ /@flags@/: the validation flags -} -> m () socketClientSetTlsValidationFlags client flags = liftIO $ do client' <- unsafeManagedPtrCastPtr client let flags' = gflagsToWord flags g_socket_client_set_tls_validation_flags client' flags' touchManagedPtr client return () data SocketClientSetTlsValidationFlagsMethodInfo instance (signature ~ ([Gio.Flags.TlsCertificateFlags] -> m ()), MonadIO m, IsSocketClient a) => O.MethodInfo SocketClientSetTlsValidationFlagsMethodInfo a signature where overloadedMethod _ = socketClientSetTlsValidationFlags