源文件名全部改为蛇形命名,public 类型名与 import 路径不变;README 目录结构同步更新;版本升级 1.2.0
This commit is contained in:
@@ -40,15 +40,15 @@ import simcu::websocket.common.WebSocketMessage
|
||||
src/
|
||||
├── websocket.cj # 模块锚点
|
||||
├── common/
|
||||
│ ├── WsTypes.cj # WebSocketMessage / ReadyState / WebSocketException / CloseCodes / WsEvents
|
||||
│ └── FrameStream.cj # RFC 6455 帧层(握手工具、掩码、分片重组、maxPayload)
|
||||
│ ├── ws_types.cj # WebSocketMessage / ReadyState / WebSocketException / CloseCodes / WsEvents
|
||||
│ └── frame_stream.cj # RFC 6455 帧层(握手工具、掩码、分片重组、maxPayload)
|
||||
├── client/
|
||||
│ └── WebSocketClient.cj # 客户端
|
||||
│ └── websocket_client.cj # 客户端
|
||||
├── server/
|
||||
│ ├── IWebsocketHandler.cj # 服务端 handler 接口(onConnect/onMessage/onClose/onError)
|
||||
│ ├── WebSocketServer.cj # 监听 / 握手 / 按路径路由 / 广播 / 组存储
|
||||
│ ├── WebSocketSenders.cj # 链式门面(组管理 + 组播/单播发送的实现)
|
||||
│ └── WebSocketConnection.cj # 服务端单条连接
|
||||
│ ├── i_websocket_handler.cj # 服务端 handler 接口(onConnect/onMessage/onClose/onError)
|
||||
│ ├── websocket_server.cj # 监听 / 握手 / 按路径路由 / 广播 / 组存储
|
||||
│ ├── websocket_senders.cj # 链式门面(组管理 + 组播/单播发送的实现)
|
||||
│ └── websocket_connection.cj # 服务端单条连接
|
||||
└── tests/
|
||||
└── websocket_test.cj # 端到端集成测试
|
||||
```
|
||||
|
||||
@@ -3,7 +3,7 @@ cjc-version = "1.1.3"
|
||||
name = "websocket"
|
||||
organization = "simcu"
|
||||
description = "SimApi WebSocket 库(RFC 6455):事件回调式客户端与接口式服务端。客户端 connect/send(三重重载)/ping/close/terminate + onOpen/onMessage/onError/onClose;服务端 WebSocketServer(port) + addHandler(path, factory) 按路径路由、每连接独立 handler,链式门面 group(name)/conn(connId) 支持组管理/组播/单播/广播,连接断开自动清组"
|
||||
version = "1.1.0"
|
||||
version = "1.2.0"
|
||||
target-dir = ""
|
||||
output-type = "static"
|
||||
|
||||
|
||||
@@ -64,6 +64,11 @@ public class WebSocketServer {
|
||||
s.bind()
|
||||
serverSock = Some(s)
|
||||
running = true
|
||||
var paths = ""
|
||||
for (p in pathFactories.keys()) {
|
||||
paths = if (paths.isEmpty()) { p } else { "${paths}, ${p}" }
|
||||
}
|
||||
println("[websocket] 已监听 端口=${localPort} 端点=[${paths}]")
|
||||
spawn { => acceptLoop() }
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user