tftp-0.2: A library for building tftp servers

Safe HaskellNone

Network.TFTP.UDPIO

Description

Buffered UDP IO utility module.

Synopsis

Documentation

newtype UDPIO a Source

A monad for UDP IO

Constructors

UDPIO 

Fields

runUDPIO :: StateT UDPIOSt IO a
 

Instances

Monad UDPIO 
Functor UDPIO 
Applicative UDPIO 
MonadIO UDPIO 
MonadState UDPIOSt UDPIO 
MessageIO UDPIO Address

Abstraction over UDP IO for sending/receiving bytestrings

type Address = SockAddrSource

Network address of a UDP sender/receiver

udpIOSource

Arguments

:: Maybe String

Hostname where the local UDP port will be bound

-> Maybe String

Port where the local UDP port will be bound

-> UDPIO a

The action to run with a reader and a writer

-> IO a

Result of the action.

Execute an action on a bound UDP port providing access to UDP IO via two functions that read and write data to/from UDP sockets. When the action returns, the socket is closed.