|
Holumbus.Network.Port | Portability | portable | Stability | experimental | Maintainer | Stefan Schmidt (stefanschmidt@web.de) |
|
|
|
|
|
Description |
Version : 0.1
Stream and Port datatype for internal an external process communication.
Useful for communikation of distributed systems.
|
|
Synopsis |
|
time1 :: Int | | time10 :: Int | | time30 :: Int | | time60 :: Int | | time120 :: Int | | timeIndefinitely :: Int | | data SocketId = SocketId HostName PortNumber | | data MessageType | | data (Show a, Binary a) => Message a | | type StreamName = String | | | | data Stream a | | data Port a | | getMessageType :: (Show a, Binary a) => Message a -> MessageType | | getMessageData :: (Show a, Binary a) => Message a -> a | | getGenericData :: (Show a, Binary a) => Message a -> Maybe ByteString | | setPortRegistry :: PortRegistry r => r -> IO () | | newGlobalStream :: (Show a, Binary a) => StreamName -> IO (Stream a) | | newLocalStream :: (Show a, Binary a) => Maybe StreamName -> IO (Stream a) | | newPrivateStream :: (Show a, Binary a) => Maybe StreamName -> IO (Stream a) | | newStream :: (Show a, Binary a) => StreamType -> Maybe StreamName -> Maybe PortNumber -> IO (Stream a) | | closeStream :: (Show a, Binary a) => Stream a -> IO () | | isEmptyStream :: Stream a -> IO Bool | | readStream :: (Show a, Binary a) => Stream a -> IO a | | readStreamMsg :: (Show a, Binary a) => Stream a -> IO (Message a) | | tryReadStream :: (Show a, Binary a) => Stream a -> IO (Maybe a) | | tryReadStreamMsg :: (Show a, Binary a) => Stream a -> IO (Maybe (Message a)) | | tryWaitReadStream :: (Show a, Binary a) => Stream a -> Int -> IO (Maybe a) | | tryWaitReadStreamMsg :: (Show a, Binary a) => Stream a -> Int -> IO (Maybe (Message a)) | | withStream :: (Show a, Binary a) => (Stream a -> IO b) -> IO b | | newPortFromStream :: Stream a -> IO (Port a) | | newPort :: StreamName -> Maybe SocketId -> IO (Port a) | | newGlobalPort :: StreamName -> IO (Port a) | | isPortLocal :: Port a -> IO Bool | | send :: (Show a, Binary a) => Port a -> a -> IO () | | sendWithGeneric :: (Show a, Binary a) => Port a -> a -> ByteString -> IO () | | sendWithMaybeGeneric :: (Show a, Binary a) => Port a -> a -> Maybe ByteString -> IO () | | writePortToFile :: (Show a, Binary a) => Port a -> FilePath -> IO () | | readPortFromFile :: (Show a, Binary a) => FilePath -> IO (Port a) | | printStreamController :: IO () |
|
|
|
Constants
|
|
|
One second
|
|
|
10 seconds
|
|
|
30 seconds
|
|
|
60 seconds
|
|
|
120 seconds
|
|
|
Wait how long it takes
|
|
Datatypes
|
|
|
All data, that is needed to address a socket.
Contains the hostname and the portNumber.
| Constructors | | Instances | |
|
|
|
Message Type
Is it an internal Message or does it come from an external Node?
| Instances | |
|
|
|
Message Datatype.
We are sending additional information, to do debugging
| Instances | |
|
|
|
The name of a stream.
|
|
|
The stream type, determines the accessibility of a stream
| Constructors | | Instances | |
|
|
|
The stream datatype
| Instances | |
|
|
|
The port datatype.
| Instances | |
|
|
Message-Operations
|
|
|
Gets the type of a message.
|
|
|
Gets the data of a message.
|
|
|
Gets the generic data (usually the return port) of a message.
|
|
Global-Operations
|
|
|
Sets the link to the PortRegistry in the stream controller
|
|
Stream-Operations
|
|
|
Creates a new global stream.
|
|
|
Creates a new local stream.
|
|
|
Creates a new private stream.
|
|
|
General function for creating a new stream.
|
|
|
Closes a stream.
|
|
|
Test, if the stream contains new messages.
|
|
|
Reads the data packet of the next message from a stream.
If stream is empty, this function will block until a new message arrives.
|
|
|
Reads the next message from a stream (data packet + message header).
If stream is empty, this function will block until a new message arrives.
|
|
|
Reads the data packet of the next message from a stream.
If stream is empty, this function will immediately return with Nothing.
|
|
|
Reads the next message from a stream (data packet + message header).
If stream is empty, this function will immediately return with Nothing.
|
|
|
Reads the data packet of the next message from a stream.
If stream is empty, this function will wait for new messages until the
time is up and if no message has arrived, return with Nothing.
|
|
|
Reads the next message from a stream (data packet + message header).
If stream is empty, this function will wait for new messages until the
time is up and if no message has arrived, return with Nothing.
|
|
|
Encapsulates a stream.
A new stream is created, then some user-action is done an after that the
stream is closed.
|
|
Port-Operations
|
|
|
Creates a new Port, which is bound to a stream.
|
|
|
Creates a new port from a streamname and its socketId.
|
|
|
Creates a new port to a global stream, only its name is needed.
|
|
|
Test, if a port is local.
|
|
|
Send data to the stream of the port.
The data is send via network, if the stream is located on an external
processor
|
|
|
Like send, but here we can give some generic data (e.g. a port for reply
messages).
|
|
|
Like sendWithGeneric, but the generic data is optional
|
|
|
Writes a port-description to a file.
Quite useful fpr sharing ports between programs
|
|
|
Reads a port-description from a file.
Quite useful fpr sharing ports between programs
|
|
Debug
|
|
|
Prints the internal data of the stream controller to stdout,
useful for debugging.
|
|
Produced by Haddock version 2.4.2 |