This commit is contained in:
joy.zhou
2019-07-15 17:20:44 +08:00
parent e1ae5ce83d
commit ec528c6bdc
2 changed files with 4 additions and 0 deletions

View File

@@ -109,6 +109,8 @@ func (c *client) readLoop() {
//add read timeout //add read timeout
if err := nc.SetReadDeadline(time.Now().Add(timeOut)); err != nil { if err := nc.SetReadDeadline(time.Now().Add(timeOut)); err != nil {
log.Error("set read timeout error: ", zap.Error(err), zap.String("ClientID", c.info.clientID)) log.Error("set read timeout error: ", zap.Error(err), zap.String("ClientID", c.info.clientID))
msg := &Message{client: c, packet: DisconnectdPacket}
b.SubmitWork(c.info.clientID, msg)
return return
} }

View File

@@ -2,6 +2,7 @@ package authhttp
import ( import (
"encoding/json" "encoding/json"
"fmt"
"io/ioutil" "io/ioutil"
"net/http" "net/http"
"net/url" "net/url"
@@ -43,6 +44,7 @@ func Init() {
if err != nil { if err != nil {
log.Fatal("Unmarshal config file error: ", zap.Error(err)) log.Fatal("Unmarshal config file error: ", zap.Error(err))
} }
fmt.Println("http: config: ", config)
httpClient = &http.Client{ httpClient = &http.Client{
Transport: &http.Transport{ Transport: &http.Transport{