aa
This commit is contained in:
@@ -16,6 +16,7 @@ import (
|
|||||||
"time"
|
"time"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
//入口
|
||||||
func ListenTcp() {
|
func ListenTcp() {
|
||||||
t := NewTcpClient()
|
t := NewTcpClient()
|
||||||
l, err := net.Listen("tcp", ":8000")
|
l, err := net.Listen("tcp", ":8000")
|
||||||
|
|||||||
@@ -113,8 +113,8 @@ type PrintInfo struct {
|
|||||||
|
|
||||||
//连接的客户端,吧每个客户端都放进来
|
//连接的客户端,吧每个客户端都放进来
|
||||||
type TcpClient struct {
|
type TcpClient struct {
|
||||||
Clients map[string]*PrintInfo
|
Clients map[string]*PrintInfo //放tcp连接的,printNo 为key
|
||||||
CallBackMap map[string]chan string
|
CallBackMap map[string]chan string //放打印信息回调信息的,printNo为key
|
||||||
*sync.RWMutex
|
*sync.RWMutex
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user