https://github.com/axionbuster/winasyncsocket
Asynchronous socket I/O in Haskell on Windows
https://github.com/axionbuster/winasyncsocket
async haskell networking socket-io windows
Last synced: 10 months ago
JSON representation
Asynchronous socket I/O in Haskell on Windows
- Host: GitHub
- URL: https://github.com/axionbuster/winasyncsocket
- Owner: axionbuster
- License: bsd-3-clause
- Created: 2025-01-23T21:15:51.000Z (about 1 year ago)
- Default Branch: master
- Last Pushed: 2025-02-17T06:53:50.000Z (11 months ago)
- Last Synced: 2025-02-17T07:32:46.795Z (11 months ago)
- Topics: async, haskell, networking, socket-io, windows
- Language: Haskell
- Homepage:
- Size: 121 KB
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# winasyncsocket: Cross-platform asynchronous socket I\/O
This package provides low-level bindings for asynchronous socket I\/O across all major platforms, integrating with each platform's native I\/O facilities:
- Windows: Windows Sockets 2 (Winsock2) with I\/O Completion Ports (IOCP)
- Linux: epoll
- macOS/BSD: kqueue
## Naming
While the package is named `winasyncsocket` due to its initial focus on Windows, it now supports all major platforms with their native asynchronous I\/O mechanisms. The name is retained for historical reasons.
## Features
- Native integration with platform-specific I\/O facilities:
- Windows: IOCP
- Linux: epoll
- macOS/BSD: kqueue
- Direct integration with GHC's I\/O manager
- Support for both IPv4 and IPv6
- Asynchronous TCP operations (accept, connect, send, receive)
- Platform-specific optimizations and features when available
## Important Notes
### Windows Users
When using this package on Windows, you must compile your program with the GHC option `-with-rtsopts=--io-manager=native`. Without this option, socket operations may stall indefinitely.
## Compatibility Note
While some function names match those in the "network" package, this package is not a drop-in replacement. The API is designed to leverage platform-specific asynchronous I\/O models for maximum performance.
## Contributing
The package welcomes contributions in these areas:
- UDP support
- Bug reports and fixes
- Extended test coverage
- Documentation improvements
- Platform-specific optimizations
- Performance benchmarks and comparisons
Please feel free to submit issues and pull requests.