https://github.com/statusfailed/cloud-haskell-socket-test
A simple telnet-chat server with cloud-haskell / distributed-process and sockets.
https://github.com/statusfailed/cloud-haskell-socket-test
Last synced: 7 months ago
JSON representation
A simple telnet-chat server with cloud-haskell / distributed-process and sockets.
- Host: GitHub
- URL: https://github.com/statusfailed/cloud-haskell-socket-test
- Owner: statusfailed
- License: bsd-3-clause
- Created: 2018-02-04T15:53:05.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2018-02-04T16:07:49.000Z (about 8 years ago)
- Last Synced: 2025-06-02T07:11:26.547Z (9 months ago)
- Language: Haskell
- Size: 5.86 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# cloud-haskell-socket-test
A "chat" server using the distributed-process family of libraries.
It really just sends bytestreams from each client to all other clients.
Not very smart!
## Install
stack build
stack exec cloud-haskell-socket-test-exe
## Use
Connect and send/receive bytes to/from other clients:
nc localhost 4444
# How it works
* Single thread accepting new connections, spawns a new local process on
client connect.
* Client thread is actually a pair of processes, both have an IORef containing
Pids of all other processes:
1. Reader: reads msgs from client, and broadcasts to other processes
2. Writer: receives raw strings from other clients and writes to socket