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
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))
msg := &Message{client: c, packet: DisconnectdPacket}
b.SubmitWork(c.info.clientID, msg)
return
}

View File

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