| CARVIEW |
Select Language
HTTP/1.1 200 OK
Connection: keep-alive
Server: nginx/1.24.0 (Ubuntu)
Content-Type: text/html; charset=utf-8
Cache-Control: public, max-age=300
Content-Encoding: gzip
Via: 1.1 varnish, 1.1 varnish
Accept-Ranges: bytes
Age: 0
Date: Sat, 17 Jan 2026 18:53:12 GMT
X-Served-By: cache-dfw-ktki8620073-DFW, cache-bom-vanm7210053-BOM
X-Cache: MISS, MISS
X-Cache-Hits: 0, 0
X-Timer: S1768675992.558689,VS0,VE851
Vary: Accept, Accept-Encoding
transfer-encoding: chunked
metro: A simple tcp and udp socket server framework
metro: A simple tcp and udp socket server framework
Modules
[Index] [Quick Jump]
Downloads
- metro-0.1.0.5.tar.gz [browse] (Cabal source package)
- Package description (as included in the package)
Maintainer's Corner
For package maintainers and hackage trustees
Candidates
| Versions [RSS] | 0.1.0.0, 0.1.0.1, 0.1.0.2, 0.1.0.3, 0.1.0.4, 0.1.0.5 |
|---|---|
| Change log | ChangeLog.md |
| Dependencies | base (>=4.7 && <5), binary, bytestring, hashable, hashmap-io, hslogger, mtl, transformers, unix-time, unliftio [details] |
| License | BSD-3-Clause |
| Copyright | MIT |
| Author | Lupino |
| Maintainer | lmjubuntu@gmail.com |
| Uploaded | by Lupino at 2021-04-09T02:49:47Z |
| Category | Network, Framework |
| Home page | https://github.com/Lupino/metro#readme |
| Bug tracker | https://github.com/Lupino/metro/issues |
| Source repo | head: git clone https://github.com/Lupino/metro |
| Distributions | |
| Reverse Dependencies | 8 direct, 0 indirect [details] |
| Downloads | 1194 total (22 in the last 30 days) |
| Rating | (no votes yet) [estimated by Bayesian average] |
| Your Rating |
|
| Status | Docs uploaded by user Build status unknown [no reports yet] |
Readme for metro-0.1.0.5
[back to package description]metro
a simple tcp and udp socket server framework
Quick start with example
import Metro.Class
import Metro.Node
import Metro.TCP
import Metro.Servable
import Metro.Session (SessionT, makeResponse_)
data CustomPacket = CustomPacket { ... }
type CustomPacketId = ...
instance RecvPacket CustomPacket where
recvPacket recv = ...
instance SendPacket CustomPacket where
sendPacket pkt send = ...
instance GetPacketId CustomPacketId where
getPacketId = ...
instance SetPacketId CustomPacketId where
setPacketId k pkt = ...
type NodeId = ...
data CustomEnv = CustomEnv { ... }
type DeviceT = NodeT CustomEnv NodeId CustomPacketId CustomPacket
type DeviceEnv = NodeEnv1 CustomEnv NodeId CustomPacketId CustomPacket
sessionHandler = makeResponse_ $ \pkt -> ...
sessionGen :: IO CustomPacketId
sessionGen = ..
prepare :: Socket -> ConnEnv tp -> IO (Maybe (NodeId, CustomEnv))
prepare sock connEnv = Just ...
keepalive = 300
bind_port = "tcp://:8080"
startExampleServer = do
sEnv <- initServerEnv "Example" (tcpConfig "tcp://:8080") sessionGen rawSocket prepare
void $ forkIO $ startServer sEnv sessionHandler
more see metro-example/src/Metro/Example.hs
Projects use metro
- haskell-hole A hole to pass through the gateway. haskell version
- metro-example An example use metro
- haskell-periodic Periodic task system haskell client and server