- 引入 LogicalConn/TransportConn 分层,ClientConn 保留兼容适配层 - 新增 Stream、Bulk、RecordStream 三条数据面能力及对应控制路径 - 完成 transfer/file 传输内核与状态快照、诊断能力 - 补齐 reconnect、inbound dispatcher、modern psk 等基础模块 - 增加大规模回归、并发与基准测试覆盖 - 更新依赖库
48 lines
936 B
Go
48 lines
936 B
Go
package notify
|
|
|
|
func (c *ClientCommon) dispatchMsg(message Message) {
|
|
switch message.TransferMsg.Type {
|
|
case MSG_SYS_WAIT:
|
|
fallthrough
|
|
case MSG_SYS:
|
|
c.sysMsg(message)
|
|
return
|
|
case MSG_KEY_CHANGE:
|
|
fallthrough
|
|
case MSG_SYS_REPLY:
|
|
fallthrough
|
|
case MSG_SYNC_REPLY:
|
|
if c.getPendingWaitPool().deliver(message.ID, message) {
|
|
return
|
|
}
|
|
fallthrough
|
|
default:
|
|
}
|
|
if c.dispatchInternalTransferControl(message) {
|
|
return
|
|
}
|
|
callFn := func(fn func(*Message)) {
|
|
fn(&message)
|
|
}
|
|
fn, ok := c.linkFns[message.Key]
|
|
if ok {
|
|
callFn(fn)
|
|
}
|
|
if c.defaultFns != nil {
|
|
callFn(c.defaultFns)
|
|
}
|
|
}
|
|
|
|
func (c *ClientCommon) sysMsg(message Message) {
|
|
switch message.Key {
|
|
case "bye":
|
|
if message.TransferMsg.Type == MSG_SYS_WAIT {
|
|
c.setByeFromServer(true)
|
|
message.Reply(nil)
|
|
c.stopClientSession("recv stop signal from server", nil)
|
|
return
|
|
}
|
|
c.stopClientSessionFromServer("recv stop signal from server", nil)
|
|
}
|
|
}
|