dbus-core-0.8.4: Low-level D-Bus protocol implementationSource codeContentsIndex
DBus.Connection
Synopsis
data Connection
connectionAddress :: Connection -> Address
connectionUUID :: Connection -> UUID
data ConnectionError
= InvalidAddress Text
| BadParameters Address Text
| UnknownMethod Address
| NoWorkingAddress [Address]
connect :: Mechanism -> Address -> IO Connection
connectFirst :: [(Mechanism, Address)] -> IO Connection
connectionClose :: Connection -> IO ()
send :: Message a => Connection -> (Serial -> IO b) -> a -> IO (Either MarshalError b)
receive :: Connection -> IO (Either UnmarshalError ReceivedMessage)
Documentation
data Connection Source

A Transport is anything which can send and receive bytestrings, typically via a socket.

Open a connection to some address, using a given authentication mechanism. If the connection fails, a ConnectionError will be thrown.

Try to open a connection to various addresses, returning the first connection which could be successfully opened.

Close an open connection. Once closed, the Connection is no longer valid and must not be used.

Send 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.

Only one message may be sent at a time; if multiple threads attempt to send messages in parallel, one will block until after the other has finished.

Receive the next message from the connection, blocking until one is available.

Only one message may be received at a time; if multiple threads attempt to receive messages in parallel, one will block until after the other has finished.

show/hide Instances
connectionAddress :: Connection -> AddressSource
connectionUUID :: Connection -> UUIDSource
data ConnectionError Source
Constructors
InvalidAddress Text
BadParameters Address Text
UnknownMethod Address
NoWorkingAddress [Address]
show/hide Instances
connect :: Mechanism -> Address -> IO ConnectionSource
connectFirst :: [(Mechanism, Address)] -> IO ConnectionSource
connectionClose :: Connection -> IO ()Source
send :: Message a => Connection -> (Serial -> IO b) -> a -> IO (Either MarshalError b)Source
receive :: Connection -> IO (Either UnmarshalError ReceivedMessage)Source
Produced by Haddock version 2.6.1