Control.Concurrent.Network.Protocol
Description
Protocol implementation. (Internal module).
A packet contains a 2 byte packet type identifier, and a possibly empty list of 2 byte length field and length byte ByteString pairs. The number of pairs in the list can be deduced from the packet identifier and the direction of the packet (slave to master - or master to slave).
- readProtoId :: Handle -> IO ProtoId
- writeProtoId :: Handle -> ProtoId -> IO ()
- readBinary :: Binary a => Handle -> IO a
- writeBinary :: Binary a => Handle -> a -> IO ()
- readByteString :: Handle -> IO ByteString
- writeByteString :: Handle -> ByteString -> IO ()
- slaveID :: NCContext -> IO Int
- numSlaves :: NCContext -> IO Int
- printMsg :: NCContext -> String -> IO ()
- data ProtoId
- data Equality
Functions
readProtoId :: Handle -> IO ProtoIdSource
Reads a packet ID from h
readByteString :: Handle -> IO ByteStringSource
Reads a ByteString from h
writeByteString :: Handle -> ByteString -> IO ()Source
Writes a ByteString
to h