 | hspread-0.3: A client library for the spread toolkit | Contents | Index |
|
|
|
|
Synopsis |
|
|
|
Documentation |
|
data OutMsg |
Message to be sent.
| Constructors | Outgoing | | outOrdering :: !OrderingType | | outDiscard :: !Bool | If True you won't get a copy of this message back from the server.
| outData :: !ByteString | Message body.
| outGroups :: ![Group] | Recipients of the message
| outMsgType :: !Word16 | To be used by the application to identify the kind of message.
|
|
| Instances | |
|
|
data InMsg |
Message received.
| Constructors | | Instances | |
|
|
data Message |
Union Type of messages that can be received from the server.
| Constructors | | Instances | |
|
|
data Group |
A Group is a collection of clients identified by a name.
| Instances | |
|
|
type PrivateGroup = Group |
A PrivateGroup identifies a connection.
|
|
data PrivateName |
Initial part of a PrivateGroup name that is chosen by the client when connecting.
| Instances | |
|
|
data GroupId |
Identifier for a membership message.
| Instances | |
|
|
data OrderingType |
Represents the orderings as specified by the Spread toolkit.
| Constructors | Unreliable | | Reliable | | Fifo | | Causal | | Agreed | | Safe | |
| Instances | |
|
|
data Cause |
What caused a membership message.
| Constructors | Join | | | Leave | | | Disconnect | | | Network | | |
| Instances | |
|
|
groupName :: Group -> ByteString |
|
privateName :: PrivateName -> ByteString |
|
data GroupMsg |
Messages used to join or leave a group.
| Constructors | | Instances | |
|
|
data MembershipMsg |
Message regarding changes in group membership.
| Constructors | | Instances | |
|
|
mkGroup :: ByteString -> Maybe Group |
|
putPadded :: Int -> ByteString -> PutM () |
|
data KillMsg |
Constructors | | Instances | |
|
|
data RejectedMsg |
Constructors | | Instances | |
|
|
data Connection |
Abstract type representing a connection with a spread server.
|
|
|
privateGroup :: Connection -> PrivateGroup |
private name of this connection, useful for p2p messages.
|
|
data Conf |
Configuration passed to connect
| Constructors | |
|
|
defaultConf :: Conf |
defaulConf = Conf Nothing Nothing (mkPrivateName (B.pack "user")) False True []
|
|
data AuthName |
Name of an authentication method.
| Instances | |
|
|
mkAuthName :: ByteString -> AuthName |
The ByteString will be truncated to the maximum allowed size.
|
|
authname :: AuthName -> ByteString |
|
type AuthMethod = (AuthName, Handle -> IO Bool) |
The action should return True if the authentication succeded.
|
|
connect :: Conf -> IO (Chan R Message, Connection) |
Connects to the specified server, will use a "NULL" authentication method if the authMethods list is empty.
A spread server will refuse the connection if another with the same PrivateName is still active.
|
|
disconnect :: Connection -> IO () |
Sends a disconnection message to the server, which will close the connection.
|
|
startReceive :: Connection -> IO Bool |
Start fetching messages from the network, returns True if it was stopped.
|
|
stopReceive :: Connection -> IO Bool |
Stop fetching messages from the network (at most one more message can be read)
, returns True if it was started.
|
|
getDupedChan :: Connection -> IO (Chan R Message) |
Messages received from now on will be available on the returned Chan
|
|
join :: Group -> Connection -> IO () |
Joins a group, the server will send a Reg.
|
|
leave :: Group -> Connection -> IO () |
Leaves a group, the server will send a SelfLeave.
|
|
send :: OutMsg -> Connection -> IO () |
Send a regular message.
|
|
Produced by Haddock version 0.8 |