HORIZON HASKELLDocslts/ghc-9.10.xc74966e2026-09-27Search names, modules, packages, or :: a typeCtrl K

GHC 9.10.3 · lts/ghc-9.10.x · c74966e · 2026-09-27

Modulenetwork-run-0.4.4Haskell2010

Network.Run.UDP

Simple functions to run UDP clients and servers.

  • 3 values
valuerunUDPServerFork
  1. :: [HostName]
  2. -> ServiceName
  3. -> Socket -> ByteString -> IO ()
  4. -> IO ()
#

Running a UDP server with a connected socket in each Haskell thread. The first request is given to the server. Suppose that the server is serving on addrS:portS and a client connects to the service from addrC:portC. A connected socket is created by binding to *:portS and connecting to addrC:portC, resulting in (UDP,addrS:portS,addrC:portC) where addrS is given magically. This approach is fragile due to NAT rebidings.