aa
This commit is contained in:
@@ -20,6 +20,7 @@ func connHandler(c net.Conn) {
|
|||||||
//缓冲
|
//缓冲
|
||||||
buf := make([]byte, 1024)
|
buf := make([]byte, 1024)
|
||||||
fmt.Println("Please input data...")
|
fmt.Println("Please input data...")
|
||||||
|
go func() {
|
||||||
for {
|
for {
|
||||||
//读取终端输入直到读取到\n
|
//读取终端输入直到读取到\n
|
||||||
//input, err := reader.ReadString('\n')
|
//input, err := reader.ReadString('\n')
|
||||||
@@ -38,4 +39,5 @@ func connHandler(c net.Conn) {
|
|||||||
//服务器端回传的信息
|
//服务器端回传的信息
|
||||||
fmt.Println("server response:", string(buf[0:cnt]))
|
fmt.Println("server response:", string(buf[0:cnt]))
|
||||||
}
|
}
|
||||||
|
}()
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user