This commit is contained in:
aozhiwei 2023-08-14 13:26:54 +08:00
parent 9a0acf9f39
commit 8dd91e03f2

View File

@ -5,6 +5,11 @@ import (
"net"
)
type WspCliConn struct {
Conn net.Conn
SocketHandle uint16
}
type MsgHdr struct {
MsgId uint16
SeqId uint32
@ -67,6 +72,15 @@ type WSProxyPackHead_S struct {
ExtLen uint16
}
func (this *WspCliConn) IsValid() bool {
return this.Conn == nil || this.SocketHandle == 0
}
func (this *WspCliConn) Reset() bool {
this.Conn = nil
this.SocketHandle == 0
}
func (this *WSProxyPackHead_C) Read(data []byte, offset int) {
this.PackLen = q5.MkUInt16(data[offset + 0], data[offset + 1])
this.MsgId = q5.MkUInt16(data[offset + 2], data[offset + 3])