mirror of
https://gitee.com/XM-GO/PandaX.git
synced 2026-06-12 09:41:03 +08:00
【fix】子设备上报方式修复
This commit is contained in:
@@ -6,7 +6,6 @@ import (
|
||||
"fmt"
|
||||
"github.com/emicklei/go-restful/v3"
|
||||
"io"
|
||||
"log"
|
||||
"net"
|
||||
"net/http"
|
||||
"pandax/iothub/hook_message_work"
|
||||
@@ -41,11 +40,10 @@ func InitHttpHook(addr string, hs *hook_message_work.HookService) {
|
||||
// 断开连接
|
||||
switch state {
|
||||
case http.StateHijacked, http.StateClosed:
|
||||
etoken, _ := activeConnections.Load(conn.RemoteAddr())
|
||||
log.Println("关闭http连接")
|
||||
etoken, _ := activeConnections.Load(conn.RemoteAddr().String())
|
||||
data := netbase.CreateConnectionInfo(message.DisConnectMes, "http", conn.RemoteAddr().String(), conn.RemoteAddr().String(), etoken.(*tool.DeviceAuth))
|
||||
activeConnections.Delete(conn.RemoteAddr().String())
|
||||
service.HookService.MessageCh <- data
|
||||
activeConnections.Delete(conn.RemoteAddr())
|
||||
}
|
||||
}
|
||||
err := server.Start(context.TODO())
|
||||
|
||||
Reference in New Issue
Block a user