This commit is contained in:
suyl
2021-07-14 14:58:16 +08:00
parent a31aede139
commit 956600b68f

View File

@@ -119,7 +119,7 @@ type PrintInfo struct {
//连接的客户端,吧每个客户端都放进来
type TcpClient struct {
Clients map[string]*PrintInfo
s sync.RWMutex
s *sync.RWMutex
}
type GetPrintStatus struct {
@@ -129,6 +129,7 @@ type GetPrintStatus struct {
func ListenTcp() {
tcpClient.Clients = make(map[string]*PrintInfo)
tcpClient.s = new(sync.RWMutex)
l, err := net.Listen("tcp", ":8000")
if err != nil {
fmt.Println("listen error:", err)