1
This commit is contained in:
parent
9a0acf9f39
commit
8dd91e03f2
14
prototils.go
14
prototils.go
@ -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])
|
||||
|
Loading…
x
Reference in New Issue
Block a user