This commit is contained in:
aozhiwei 2023-09-24 15:50:56 +08:00
parent 6d65053204
commit bbd1c7a7f2
3 changed files with 16 additions and 2 deletions

View File

@ -1,5 +1,9 @@
package constant package constant
import (
"f5"
)
const ( const (
PLAYER_MGR_HANDLER_ID = iota PLAYER_MGR_HANDLER_ID = iota
PLAYER_HANDLER_ID PLAYER_HANDLER_ID
@ -8,6 +12,10 @@ const (
WSP_LISTENER_HANDLER_ID WSP_LISTENER_HANDLER_ID
) )
const (
IM_WSP_CLOSE = f5.IM_CUSTOM_MSG_BEGIN + 1
)
const ( const (
MAX_PACKET_LEN = 1024 * 64 MAX_PACKET_LEN = 1024 * 64
) )

View File

@ -60,7 +60,13 @@ func (this *WSPListener) socketRead(conn net.Conn) {
recvBuf := make([]byte, 1024*64*2) recvBuf := make([]byte, 1024*64*2)
for { for {
bufLen, err := conn.Read(buf) bufLen, err := conn.Read(buf)
if err == nil && bufLen > 0 { if err != nil {
f5.GetApp().AddIMMsg(constant.IM_WSP_CLOSE, []interface{} {
conn,
})
return
}
if bufLen > 0 {
alreadyReadBytes := 0 alreadyReadBytes := 0
for { for {
{ {

2
third_party/f5 vendored

@ -1 +1 @@
Subproject commit 194793c17868a2ecc9ada927a8cfecf628152812 Subproject commit f79618418ed89343a56ca53b8acc9a3cbd07ac30