uniform-io-1.0.0.0: Uniform IO over files, network, anything.

Safe HaskellNone
LanguageHaskell2010

System.IO.Uniform.Network

Synopsis

Documentation

data BoundedPort Source

A bounded IP port from where to accept SocketIO connections.

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 BoundedPort 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 bounded, a process can reduce its privileges and still accept clients on that port.

accept :: BoundedPort -> IO SocketIO Source

accept port

Accept clients on a port previously bound with bindPort.

closePort :: BoundedPort -> IO () Source

Closes a BoundedPort, and releases any resource used by it.

getPeer :: SocketIO -> IO (IP, Int) Source

Gets the address of the peer socket of a internet connection.