Open elliotmr opened 5 years ago
Holy smokes, I just saw that it is specifically setting the file descriptor to be blocking instead of blocking. Is there a specific reason for this?
Just for a little more context, since Go 1.11, if you open an os.File in non-blocking mode, it will add it to the runtime poller and you won't have to sit with a blocked os thread when you call read. This has the added benefit of allowing a concurrent close to the port and it then kicking you out of an active read.
the call to
p.f.Fd()
inside thePort.Flush()
sets the file descriptor to blocking mode. Either we should save a reference to the file descriptor in the object field or set the fd back to non-blocking mode after flush is complete.