Safe Haskell | None |
---|---|
Language | Haskell2010 |
- data TlsSettings = TlsSettings {}
- class UniformIO a where
- fRead :: a -> Int -> IO ByteString
- fPut :: a -> ByteString -> IO ()
- fClose :: a -> IO ()
- startTls :: TlsSettings -> a -> IO TlsStream
- isSecure :: a -> Bool
- data SocketIO
- data FileIO
- data TlsStream
- data BoundPort
- data SomeIO = forall a . UniformIO a => SomeIO a
- connectTo :: IP -> Int -> IO SocketIO
- connectToHost :: String -> Int -> IO SocketIO
- bindPort :: Int -> IO BoundPort
- accept :: BoundPort -> IO SocketIO
- openFile :: String -> IO FileIO
- getPeer :: SocketIO -> IO (IP, Int)
- closePort :: BoundPort -> IO ()
Documentation
data TlsSettings Source
Settings for starttls functions.
class UniformIO a where Source
Typeclass for IO objects that behave like a Unix file (independent of seeking support).
fRead :: a -> Int -> IO ByteString Source
fRead fd n Reads a block of at most n bytes of data from the filelike object fd. Reading will block if there's no data available, but will return immediately if any amount of data is availble.
fPut :: a -> ByteString -> IO () Source
fPut fd text Writes all the bytes of text into the filelike object. Takes care of retrying if needed.
fClose fd Closes the filelike object, releasing any allocated resource. Resources may leak if not called for every oppened fd.
startTls :: TlsSettings -> a -> IO TlsStream Source
startTLS fd Starts a TLS connection over the filelike object.
isSecure fd Indicates whether the data written or read from fd is secure at transport.
A type that wraps any type in the UniformIO class.
connectTo :: IP -> Int -> IO SocketIO Source
ConnecctTo ipAddress port Connects to the given port of the host at the given IP address.
connectToHost :: String -> Int -> IO SocketIO Source
connectToHost hostName port Connects to the given host and port.
bindPort :: Int -> IO BoundPort Source
bindPort port Binds to the given IP port, becoming ready to accept connections on it. Binding to port numbers under 1024 will fail unless performed by the superuser, once bound, a process can reduce its privileges and still accept clients on that port.
accept :: BoundPort -> IO SocketIO Source
accept port Accept clients on a port previously bound with bindPort.