3 ms·
A TCP half-close, with a FIN? I think that's a limitation of the socket system call API itself.
by tptacek 7y ago
A TCP half-close, with a FIN? I think that's a limitation of the socket system call API itself.
- markdog12 7y agoYeah, I wasn't sure. I was looking at a Dart MySQL connection pool implementation, and that's what's done. socket.listen(onData, onDone: onSocketDone); onSocketDone() { _closed = true; } write(Buffer buffer) { if (_closed) throw StateError('Cannot write to socket, it is closed'); ...write } onData(RawSocketEvent event) { if (event == RawSocketEvent.READ_CLOSED) { _closed = true; } // Other events handled as well, READ, CLOSED, WRITE } But I don't know what's going on under the hood there.