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