|
Holumbus.Network.Communication | Portability | portable | Stability | experimental | Maintainer | Stefan Schmidt (stefanschmidt@web.de) |
|
|
|
|
|
Description |
Version : 0.1
This module implements an abstract client server model. The clients register
at the server and check from time to time if the server still exists. If not,
the client searches for a new server.
The server on the other hand, keeps a list with all clients and checks, if
each client is reachable. If not, the client is deleted from the list.
This abstract network model helps us to implement a basic distrubuted system
with a central server and many attached clients which get little tasks from
the server. Because this model alone would be very unfunctional, the user is
able to define his own functions which will be handled by the server or the
client.
|
|
Synopsis |
|
|
|
Documentation |
|
|
The name of a stream.
|
|
|
All data, that is needed to address a socket.
Contains the hostname and the portNumber.
| Instances | |
|
|
PortNumber (PortNum) |
|
|
30 seconds
|
|
|
Wait how long it takes
|
|
|
The type of the client id.
|
|
|
Constructors | ClientInfo | | ci_Id :: Int | | ci_Site :: SiteId | SiteId (Hostname,PID) of the client process
| ci_Port :: ClientPort | the port of the client
| ci_PingThreadId :: Thread | the threadId of the ping-Process (needed to stop it)
| ci_LifeValue :: Int | |
|
| Instances | |
|
|
server operations
|
|
|
The server.
| Instances | |
|
|
|
|
|
|
Closes the server.
|
|
|
The ServerPort is only a wrapper for a Port-Datatype.
| Instances | |
|
|
|
Creates a new ServerPort.
|
|
|
:: (Show a, Binary a, Binary b) | | => ServerPort | | -> Int | | -> a | | -> b -> IO (Maybe c) | response handler
| -> IO c | | Sends a request from the client to the server an handles the response or
invokes a user-defined handler.
|
|
|
|
Gets the ClientPort from a ClientId (on the Server).
|
|
|
Gets a list with all registered clients (on the Server).
|
|
client operations
|
|
class ClientClass c where | Source |
|
The request-functions a client has to implement.
| | Methods | | Check, if the client is responding.
| | | Get the ID of the client.
| | | Gets the server port the client wants to connect to.
|
| | Instances | |
|
|
|
Only a wrapper around an MVar.
| Instances | |
|
|
|
|
|
|
Closes the client.
|
|
|
Just a wrapper around a port.
| Instances | |
|
|
|
:: (Show a, Binary a, Binary b) | | => ClientPort | | -> Int | | -> a | | -> b -> IO (Maybe c) | response handler
| -> IO c | | Sends a request from the server to the client an handles the response or
invokes a user-defined handler.
|
|
|
Produced by Haddock version 2.4.2 |