Moduledbus-1.4.1Haskell2010
DBus.Socket
D-Bus sockets are used for communication between two peers. In this model, there is no "bus" or "client", simply two endpoints sending messages.
Most users will want to use the DBus.Client module instead.
- 5 types
- 21 values
- Packagedbus-1.4.1
- Exports26
- LanguageHaskell2010
- LicenceApache-2.0
- SourceSocket.hs
Sockets
3 declarationsSend a single message, with a generated Serial. The second parameter exists to prevent race conditions when registering a reply handler; it receives the serial the message will be sent with, before it's actually sent.
Sockets are thread-safe. Only one message may be sent at a time; if multiple threads attempt to send messages concurrently, one will block until after the other has finished.
Throws SocketError on failure.
Receive the next message from the socket , blocking until one is available.
Sockets are thread-safe. Only one message may be received at a time; if multiple threads attempt to receive messages concurrently, one will block until after the other has finished.
Throws SocketError on failure.
Socket errors
5 declarationsStores information about an error encountered while creating or using a Socket.
Instances3Eq, Show, Exception
Eq SocketErrorDefined in dbus-1.4.1 · DBus.SocketShow SocketErrorDefined in dbus-1.4.1 · DBus.SocketException SocketErrorDefined in dbus-1.4.1 · DBus.Socket
Socket options
4 declarationsUsed with openWith and listenWith to provide custom authenticators or transport options.
Used to perform authentication with the remote peer. After a transport has been opened, it will be passed to the authenticator. If the authenticator returns true, then the socket was authenticated.
Options for the underlying transport, to be used by custom transports for controlling how to connect to the remote peer.
See DBus.Transport for details on defining custom transports
Default SocketOptions, which uses the default Unix/TCP transport and authenticator (without support for Unix file descriptor passing).
Opening and closing sockets
3 declarationsOpen a socket to a remote peer listening at the given address.
open = openWith defaultSocketOptions
Throws SocketError on failure.
Open a socket to a remote peer listening at the given address.
Most users should use open. This function is for users who need to define custom authenticators or transports.
Throws SocketError on failure.
Close an open Socket. Once closed, the socket is no longer valid and must not be used.
Listening for connections
6 declarationsBegin listening at the given address.
Use accept to create sockets from incoming connections.
Use closeListener to stop listening, and to free underlying transport resources such as file descriptors.
Throws SocketError on failure.
Begin listening at the given address.
Use accept to create sockets from incoming connections.
Use closeListener to stop listening, and to free underlying transport resources such as file descriptors.
This function is for users who need to define custom authenticators or transports.
Throws SocketError on failure.
Accept a new connection from a socket listener.
Throws SocketError on failure.
Close an open SocketListener. Once closed, the listener is no longer valid and must not be used.
Get the address to use to connect to a listener.
Authentication
5 declarationsAn Authenticator defines how the local peer (client) authenticates itself to the remote peer (server).
An empty authenticator. Use authenticatorClient or authenticatorServer to control how the authentication is performed.
myAuthenticator :: Authenticator MyTransport
myAuthenticator = authenticator
{ authenticatorClient = clientMyAuth
, authenticatorServer = serverMyAuth
}
clientMyAuth :: MyTransport -> IO Bool
serverMyAuth :: MyTransport -> String -> IO Bool
An authenticator that implements the D-Bus EXTERNAL mechanism, which uses
credential passing over a Unix socket, with support for Unix file descriptor passing.
Defines the client-side half of an authenticator.
Defines the server-side half of an authenticator. The UUID is allocated by the socket listener.