mirror of
https://github.com/Rain-kl/OpenFlare.git
synced 2026-10-08 08:36:37 +08:00
[优化] 修复增强
This commit is contained in:
@@ -95,6 +95,7 @@ func (conn *Connection) SendPing() error {
|
|||||||
return errors.New("relay ws connection is nil")
|
return errors.New("relay ws connection is nil")
|
||||||
}
|
}
|
||||||
slog.Debug("relay ws sending ping")
|
slog.Debug("relay ws sending ping")
|
||||||
|
_ = conn.conn.SetWriteDeadline(time.Now().Add(5 * time.Second))
|
||||||
return websocket.JSON.Send(conn.conn, service.WSMessage{
|
return websocket.JSON.Send(conn.conn, service.WSMessage{
|
||||||
Type: "ping",
|
Type: "ping",
|
||||||
})
|
})
|
||||||
@@ -105,6 +106,7 @@ func (conn *Connection) SendPong() error {
|
|||||||
return errors.New("relay ws connection is nil")
|
return errors.New("relay ws connection is nil")
|
||||||
}
|
}
|
||||||
slog.Debug("relay ws sending pong")
|
slog.Debug("relay ws sending pong")
|
||||||
|
_ = conn.conn.SetWriteDeadline(time.Now().Add(5 * time.Second))
|
||||||
return websocket.JSON.Send(conn.conn, service.WSMessage{
|
return websocket.JSON.Send(conn.conn, service.WSMessage{
|
||||||
Type: "pong",
|
Type: "pong",
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -95,6 +95,7 @@ func (conn *Connection) SendPong() error {
|
|||||||
return errors.New("flared ws connection is nil")
|
return errors.New("flared ws connection is nil")
|
||||||
}
|
}
|
||||||
slog.Debug("flared ws sending pong")
|
slog.Debug("flared ws sending pong")
|
||||||
|
_ = conn.conn.SetWriteDeadline(time.Now().Add(5 * time.Second))
|
||||||
return websocket.JSON.Send(conn.conn, service.WSMessage{
|
return websocket.JSON.Send(conn.conn, service.WSMessage{
|
||||||
Type: "pong",
|
Type: "pong",
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user