Closed sleep2death closed 5 years ago
evio_unix will auto close the connections, when no data is read out
Evio isn't auto-closing connections. When no data is read from syscall.Read
, this means that the connection should be closed.
From: http://pubs.opengroup.org/onlinepubs/009695399/functions/read.html
If the starting position is at or after the end-of-file, 0 shall be returned.
From: http://man7.org/linux/man-pages/man2/read.2.html
On success, the number of bytes read is returned (zero indicates end of file), and the file position is advanced by this number.
System: MacOs Mojave, Serve address: tcp://localhost:8081?reuseport=true Test Code: ` var conns []net.Conn
for count := 0; count < 10; count++ { conn, err := net.Dial("tcp", "localhost:8101") conns = append(conns, conn)
}
for index, conn := range conns { str := fmt.Sprintf("Hello, Evio, from conn: %d\n", index) conn.Write([]byte(str)) }