The socket-unix package

[maintain]

A Unix domain socket extension for the socket library


[Skip to ReadMe]

Properties

Versions0.1.0.0, 0.1.0.0, 0.1.1.0, 0.2.0.0
Dependenciesbase (>=4.7 && <5), bytestring (>=0.10.0.0 && <0.11), socket (>=0.6.0.0 && <0.8.0.0) [details]
LicenseMIT
Copyright2017 Vyacheslav Hashov
AuthorVyacheslav Hashov
Maintainervyacheslavhashov@gmail.com
CategorySystem, Network
Home pagehttps://github.com/vyacheslavhashov/haskell-socket-unix#readme
Source repositoryhead: git clone https://github.com/vyacheslavhashov/haskell-socket-unix
UploadedFri Jan 6 05:16:49 UTC 2017 by VyacheslavHashov

Modules

[Index]

Downloads

Maintainers' corner

For package maintainers and hackage trustees

Readme for socket-unix-0.1.0.0

Available on Hackage License MIT Build Status

socket-unix

A Unix domain socket API for the socket library.

Usage

Creating the Unix domain socket:

import System.Socket
import System.Socket.Type.Stream
import System.Socket.Family.Unix

s <- socket :: IO (Socket Unix Stream Unix)

Creating the address for binding/connecting

address <- case socketAddressUnixPath "example.sock" of
             Just addr -> pure addr
             Nothing -> putStrLn "invalid pathname for socket"

Symlinks

Binding to a socket with a filename creates a socket in the filesystem, but does not unlink it after close called. You should handle deleting links yourself.

Portability

Only Linux is supported.