mirror of
https://gogs.blitter.com/RLabs/xs
synced 2024-08-14 10:26:42 +00:00
KeepAlive WIP. TODO: check exitStatus logic for shell 'exit' clean exit
This commit is contained in:
parent
d0f8751b2b
commit
9244cc9785
3 changed files with 10 additions and 10 deletions
13
xsnet/net.go
13
xsnet/net.go
|
@ -1196,7 +1196,7 @@ func (hl *HKExListener) Accept() (hc Conn, err error) {
|
|||
// packet processing.
|
||||
//
|
||||
// See go doc io.Reader
|
||||
func (hc Conn) Read(b []byte) (n int, err error) {
|
||||
func (hc *Conn) Read(b []byte) (n int, err error) {
|
||||
for {
|
||||
if hc.dBuf.Len() > 0 {
|
||||
break
|
||||
|
@ -1214,7 +1214,8 @@ func (hc Conn) Read(b []byte) (n int, err error) {
|
|||
return 0, io.EOF
|
||||
}
|
||||
if strings.HasSuffix(err.Error(), "use of closed network connection") {
|
||||
logger.LogDebug(fmt.Sprintln("[Client hung up]"))
|
||||
logger.LogDebug(fmt.Sprintln("[Client hung up(1)]"))
|
||||
//!rlm hc.SetStatus(CSENone) //FIXME: re-examine this (exit 9 w/o it - 2023-11-05)
|
||||
return 0, io.EOF
|
||||
}
|
||||
etxt := fmt.Sprintf("** Failed read:%s (%s) **", "ctrlStatOp", err)
|
||||
|
@ -1237,7 +1238,7 @@ func (hc Conn) Read(b []byte) (n int, err error) {
|
|||
return 0, io.EOF
|
||||
}
|
||||
if strings.HasSuffix(err.Error(), "use of closed network connection") {
|
||||
logger.LogDebug(fmt.Sprintln("[Client hung up]"))
|
||||
logger.LogDebug(fmt.Sprintln("[Client hung up(2)]"))
|
||||
return 0, io.EOF
|
||||
}
|
||||
etxt := fmt.Sprintf("** Failed read:%s (%s) **", "HMAC", err)
|
||||
|
@ -1253,7 +1254,7 @@ func (hc Conn) Read(b []byte) (n int, err error) {
|
|||
return 0, io.EOF
|
||||
}
|
||||
if strings.HasSuffix(err.Error(), "use of closed network connection") {
|
||||
logger.LogDebug(fmt.Sprintln("[Client hung up]"))
|
||||
logger.LogDebug(fmt.Sprintln("[Client hung up(3)]"))
|
||||
return 0, io.EOF
|
||||
}
|
||||
etxt := fmt.Sprintf("** Failed read:%s (%s) **", "payloadLen", err)
|
||||
|
@ -1276,7 +1277,7 @@ func (hc Conn) Read(b []byte) (n int, err error) {
|
|||
return 0, io.EOF
|
||||
}
|
||||
if strings.HasSuffix(err.Error(), "use of closed network connection") {
|
||||
logger.LogDebug(fmt.Sprintln("[Client hung up]"))
|
||||
logger.LogDebug(fmt.Sprintln("[Client hung up(4)]"))
|
||||
return 0, io.EOF
|
||||
}
|
||||
etxt := fmt.Sprintf("** Failed read:%s (%s) **", "payloadBytes", err)
|
||||
|
@ -1647,7 +1648,7 @@ func (hc *Conn) keepaliveHelper() {
|
|||
}
|
||||
time.Sleep(time.Duration(nextDuration) * time.Millisecond)
|
||||
hc.keepalive -= 1
|
||||
|
||||
logger.LogDebug(fmt.Sprintf("[keepAlive is now %d]\n", hc.keepalive))
|
||||
//if rand.Intn(32) == 0 {
|
||||
// hc.keepalive = 0
|
||||
//}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue