stdio-0.2.0.0: A simple and high performance IO toolkit for Haskell

Copyright(c) Dong Han 2018
LicenseBSD
Maintainerwinterland1989@gmail.com
Stabilityexperimental
Portabilitynon-portable
Safe HaskellNone
LanguageHaskell2010

Std.IO.TCP

Contents

Description

This module provides an API for creating TCP servers and clients.

Synopsis

TCP Client

data ClientConfig Source #

A TCP client configuration

Constructors

ClientConfig 

Fields

TCP Server

data ServerConfig Source #

A TCP server configuration

Constructors

ServerConfig 

Fields

defaultServerConfig :: ServerConfig Source #

A default hello world server on localhost:8888

Test it with main = startServer defaultServerConfig, now try nc -v 127.0.0.1 8888

startServer :: HasCallStack => ServerConfig -> IO () Source #

Start a server

Fork new worker thread upon a new connection.