{"id":18571858,"url":"https://github.com/lpeterse/haskell-socket","last_synced_at":"2025-04-10T07:30:50.239Z","repository":{"id":32171642,"uuid":"35744954","full_name":"lpeterse/haskell-socket","owner":"lpeterse","description":"A Haskell binding to the POSIX sockets API","archived":false,"fork":false,"pushed_at":"2022-03-19T22:26:48.000Z","size":493,"stargazers_count":47,"open_issues_count":14,"forks_count":10,"subscribers_count":5,"default_branch":"master","last_synced_at":"2024-10-06T03:13:18.040Z","etag":null,"topics":["haskell","network","socket"],"latest_commit_sha":null,"homepage":"","language":"Haskell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/lpeterse.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-05-16T23:59:47.000Z","updated_at":"2023-02-20T17:55:29.000Z","dependencies_parsed_at":"2022-08-20T23:10:18.927Z","dependency_job_id":null,"html_url":"https://github.com/lpeterse/haskell-socket","commit_stats":null,"previous_names":[],"tags_count":21,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lpeterse%2Fhaskell-socket","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lpeterse%2Fhaskell-socket/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lpeterse%2Fhaskell-socket/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lpeterse%2Fhaskell-socket/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lpeterse","download_url":"https://codeload.github.com/lpeterse/haskell-socket/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223430338,"owners_count":17143624,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["haskell","network","socket"],"created_at":"2024-11-06T23:04:00.572Z","updated_at":"2024-11-06T23:04:01.016Z","avatar_url":"https://github.com/lpeterse.png","language":"Haskell","funding_links":[],"categories":[],"sub_categories":[],"readme":"socket\n======\n\n[![Available on Hackage][badge-hackage]][hackage]\n[![License MIT][badge-license]][license]\n[![Build Status][badge-travis]][travis]\n[![AppVeyor][badge-appveyor]][appveyor]\n\n### Motivation\n\nThis library aims to expose a minimal and cross-platform interface for\nBSD style networking code.\n\n### Implementation Philosophy\n\n  - Every operation and every flag exposed should be supported with same\n    semantics on every platform. If this cannot be guaranteed it should\n    be supplied by another (extension) package.\n\n  - Absolutely no conditional exports.\n\n  - No `#ifdef` madness in the Haskell sources. The Haskell binding code\n    uses the FFI to reference platform dependant C functions for each operation.\n    If a platform is not POSIX compliant (i.e. Windows) equivalent functionality\n    is implemented by using whatever the platform specific building blocks are.\n\n### Platform Support\n\n#### Linux\n\nPlatform is fully supported. Each commit and release is automatically tested with\n[Travis CI](https://travis-ci.org/lpeterse/haskell-socket) and several versions\nof GHC.\n\n#### Windows\n\nFully supported on Windows7 (maybe Vista) or higher :-)\n\nGHC's runtime system on Windows does not offer an event notification mechanism for sockets.\nThe original [network](https://hackage.haskell.org/package/network) library\nsuffers from this, too. For example, connection attempts are non-interruptible etc.\nThe approach taken to circumvent this in this library is to poll the\nnon-blocking sockets with increasing delay. This guarantees interruptibility\nand fairness between different threads. It allows for decent throughput\nwhile also keeping CPU consumption on a moderate level if a socket has not seen\nevents for a longer period of time (maximum of 1 second delay after 20\npolling iterations). The only drawback is potentially reduced response time\nof your application. The good part: Heavy load (e.g. connection requests or\nincoming traffic) will reduce this problem. Eventually your accepting thread\nwon't wait at all if there are several connection requests queued.\n\nThis workaround may be removed if someone is willing to sacrifice to improve\nthe IO manager on Windows.\n\nEach commit and release is automatically tested with\n[AppVeyor](https://ci.appveyor.com/project/lpeterse/haskell-socket) continuous\nintegration.\n\n#### MacOS\n\nWorking, but not regularly tested.\n\nPlease report when it is no longer working on MacOS.\n\n### Dependencies\n\n   - base\n   - bytestring\n\n### Tests\n\nThe project uses [tasty](http://documentup.com/feuerbach/tasty) for testing.\n\nThere are two test suites: `default` and `threaded` which share the same\ncode. The only difference is that one is compiled against GHC's single threaded\nRTS and the other against the multi-threaded one. Run `cabal test` or `stack test`\nto execute both in sequence.\n\n[badge-travis]: https://img.shields.io/travis/lpeterse/haskell-socket.svg?label=Linux%20build\n[travis]: https://travis-ci.org/lpeterse/haskell-socket\n[badge-appveyor]: https://img.shields.io/appveyor/ci/lpeterse/haskell-socket.svg?label=Windows%20build\n[appveyor]: https://ci.appveyor.com/project/lpeterse/haskell-socket\n[badge-hackage]: https://img.shields.io/hackage/v/socket.svg?dummy\n[hackage]: https://hackage.haskell.org/package/socket\n[badge-license]: https://img.shields.io/badge/license-MIT-green.svg?dummy\n[license]: https://github.com/lpeterse/haskell-socket/blob/master/LICENSE\n[issues]: https://github.com/lpeterse/haskell-socket/issues\n[Github]: https://github.com/lpeterse/haskell-socket\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flpeterse%2Fhaskell-socket","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flpeterse%2Fhaskell-socket","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flpeterse%2Fhaskell-socket/lists"}