This commit is contained in:
邹宗楠
2023-02-09 11:35:17 +08:00
parent aedff383c6
commit e15f83f913
2 changed files with 61 additions and 25 deletions

View File

@@ -34,6 +34,8 @@ func ListenTcp() {
}
}
var clientMap = make(map[string]*TcpClient, 0)
func (t *TcpClient) handleConn(c net.Conn) {
if c == nil {
globals.SugarLogger.Debugf("conn is nil")
@@ -162,31 +164,6 @@ func (t *TcpClient) changePrintMsg(data string, orderNo int64, printNo string) (
return err
}
//
//var (
// printClient = make(map[string]*TcpClient, 0)
// db = dao.GetDB()
// offset, pageSize = 0, 100
//)
//
//func init() {
// go func() {
// for {
// if time.Now().Unix()%2 != 0 {
// continue
// }
// for printNo, PrintTcpClient := range printClient {
// if !PrintTcpClient.isExistMsg(printNo) {
// return
// }
//
// }
//
// }
// }()
//
//}
func (t *TcpClient) HandleTcpMessages(printNo string) {
var (
db = dao.GetDB()
@@ -220,6 +197,7 @@ func (t *TcpClient) HandleTcpMessages(printNo string) {
}
}()
}
func (t *TcpClient) readTimeoutMap(key string) bool {
t.Lock()
defer t.Unlock()