AlexStocks edited a comment on issue #77:
URL: https://github.com/apache/dubbo-getty/issues/77#issuecomment-939652203
as internal/poll/fd_posix.go fd.eofError shows, when got eof error, the tcp
stream buffer length is zero. So this issue is not valid.
What's more, even if the return value "len != 0, error == eof", we will get
"len == 0, error == eof" if we continue to read the closed socket as the
following examples.
1. firstly, we start a nc tcp server.
```
nc -lk 127.0.0.1 20000
```
2. start a go client.
```go
package main
import (
"log"
"net"
"os"
"time"
)
func main() {
conn, err := net.Dial("tcp", "127.0.0.1:20000")
if err != nil {
log.Println("dial failed:", err)
os.Exit(1)
}
defer conn.Close()
buffer := make([]byte, 512)
for {
conn.SetReadDeadline(time.Now().Add(1 * time.Second))
n, err := conn.Read(buffer)
if err != nil {
log.Println("Read failed, error:", err, ", count: ", n)
// return
} else {
log.Println("count:", n, "msg:", string(buffer))
}
time.Sleep(3e9)
}
}
```
3. After start the go client successfully, close the nc tcp server.
4. The output of the go tcp client is as follows.

--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]