socket: A portable and extensible sockets library.
Motivation
This library aims to expose a minimal and platform-independant interface for POSIX compliant networking code.
Implementation Philosophy
Every operation and every flag exposed should be supported with same semantics on every platform. If this cannot be guaranteed it should be supplied by another (extension) package. Examples for things that have been ripped out of this library are: Unix sockets, SCTP, vectored IO (for now).
Absolutely no conditional export.
No `#ifdef` madness in the Haskell sources. The Haskell binding code uses the FFI to reference the platform's native networking functions. If they are not Posix compliant (i.e. under Windows) an level of indirection is introduced to write an Posix compliant equivalent in C using whatever the plaform specific building blocks are.
Platform Support
Linux: Working.
BSD: Unknown. Should work. Please report if not.
OS X: Unknown. Please report if you have a Mac.
Windows: Fully supported on Windows7 (maybe Vista) or higher :-)
GHCs runtime system on Windows does not offer an event notification mechanism for sockets. The original network library suffers from this, too. For example, connection attempts are uninterruptible etc. The approach taken to circumvent this in this library is to poll the non-blocking sockets with increasing delay. This guarantees interruptability and fairness between different threads. It allows for decent throughput while also keeping CPU consumption on a moderate level if a socket has not seen events for a longer period of time (maximum of 1 second delay after 20 polling iterations). The only drawback is potentially reduced response time of your application. The good part: Heavy load (e.g. connection requests or incoming traffic) will reduce this problem. Eventually your accepting thread won't wait at all if there are several connection requests queued.
This workaround may be removed if someone is willing to sacrifice to improve the IO manager on Windows.
[Skip to Readme]
Modules
- System
- System.Socket
- System.Socket.Family
- System.Socket.Family.INET
- System.Socket.Family.INET6
- System.Socket.Protocol
- System.Socket.Protocol.TCP
- System.Socket.Protocol.UDP
- System.Socket.Type
- System.Socket.Type.DGRAM
- System.Socket.Type.RAW
- System.Socket.Type.SEQPACKET
- System.Socket.Type.STREAM
- System.Socket.Unsafe
- System.Socket.Family
- System.Socket
Downloads
- socket-0.4.0.0.tar.gz [browse] (Cabal source package)
- Package description (revised from the package)
Note: This package has metadata revisions in the cabal description newer than included in the tarball. To unpack the package including the revisions, use 'cabal get'.
Maintainer's Corner
For package maintainers and hackage trustees
Candidates
- No Candidates
Versions [RSS] | 0.1.0.0, 0.1.0.1, 0.2.0.0, 0.3.0.1, 0.4.0.0, 0.4.0.1, 0.5.0.0, 0.5.1.0, 0.5.2.0, 0.5.3.0, 0.5.3.1, 0.6.0.0, 0.6.0.1, 0.6.1.0, 0.6.2.0, 0.7.0.0, 0.8.0.0, 0.8.0.1, 0.8.1.0, 0.8.2.0, 0.8.3.0 (info) |
---|---|
Change log | CHANGELOG.md |
Dependencies | base (<0), bytestring (<0.11) [details] |
Tested with | ghc ==7.10.1, ghc ==7.8.3 |
License | MIT |
Author | Lars Petersen |
Maintainer | info@lars-petersen.net |
Revised | Revision 1 made by HerbertValerioRiedel at 2015-08-26T09:26:39Z |
Category | System, Network |
Home page | https://github.com/lpeterse/haskell-socket |
Bug tracker | https://github.com/lpeterse/haskell-socket/issues |
Source repo | head: git clone git://github.com/lpeterse/haskell-socket.git |
Uploaded | by LarsPetersen at 2015-06-16T11:55:11Z |
Distributions | NixOS:0.8.3.0, Stackage:0.8.3.0 |
Reverse Dependencies | 8 direct, 1 indirect [details] |
Downloads | 16390 total (5 in the last 30 days) |
Rating | 2.0 (votes: 1) [estimated by Bayesian average] |
Your Rating | |
Status | Docs not available [build log] All reported builds failed as of 2016-12-01 [all 6 reports] |