新增处理
This commit is contained in:
@@ -46,6 +46,7 @@ func (h *TCPHandler) HandleClient(conn net.Conn) {
|
||||
output = strings.ReplaceAll(output, "\n", "")
|
||||
message = []byte(output)
|
||||
fmt.Printf("收到消息来自 %s: %s\n", conn.RemoteAddr(), message)
|
||||
|
||||
if !json.Valid(message) {
|
||||
fmt.Printf("来自客户端的数据非法 %s\n", conn.RemoteAddr())
|
||||
conn.Close()
|
||||
@@ -252,7 +253,6 @@ func (s *Server) StopRealTimeReporting(client *Client, message []byte) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// TimingReporting 定时上报数据
|
||||
func (s *Server) TimingReporting(client *Client, message []byte) error {
|
||||
var msg Message
|
||||
if err := json.Unmarshal(message, &msg); err != nil {
|
||||
|
||||
Reference in New Issue
Block a user