socket-unix: A Unix domain sockets

This is a package candidate release! Here you can preview how this package release will appear once published to the main package index (which can be accomplished via the 'maintain' link below). Please note that once a package has been published to the main package index it cannot be undone! Please consult the package uploading documentation for more information.

[maintain] [Publish]

A Unix domain socket extension for the socket library


[Skip to Readme]

Properties

Versions 0.1.0.0, 0.1.0.0, 0.1.1.0, 0.2.0.0
Change log None available
Dependencies base (>=4.7 && <5), bytestring (>=0.10.0.0 && <0.11), socket (>=0.6.0.0 && <0.8.0.0) [details]
License MIT
Copyright 2017 Vyacheslav Hashov
Author Vyacheslav Hashov
Maintainer vyacheslavhashov@gmail.com
Category System, Network
Home page https://github.com/vyacheslavhashov/haskell-socket-unix#readme
Source repo head: git clone https://github.com/vyacheslavhashov/haskell-socket-unix
Uploaded by VyacheslavHashov at 2017-01-06T05:16:49Z

Modules

[Index]

Downloads

Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees


Readme for socket-unix-0.1.0.0

[back to package description]

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"

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.