作者:kenyousay | 来源:互联网 | 2023-10-10 17:22
That error occurs at random, every few thousand requests. It fails the program with abort().
I also discovered that after nn_term, a try to nn_poll fails with EPERM and also a worker which is in the moment doing nn_recv fails with EINVAL. Shouldn't they (and probably also assert'ions which call abort) instead fail with ETERM?
I'm on Win7 x86 with nanomsg-0.4-beta.
该提问来源于开源项目:nanomsg/nanomsg
Not so sure now. The EPERM is certainly a windows quirk, when using a bogus handle. I believe that now the code will return either ETERM or EBADFD. (The problem of using the lower level operating system select() call is that we don't really have much control over the errno.)
In any event, its kind of a gross programming error to call nn_term() if you have any other I/O pending. The library tries to clean that up, but it can only do so much.
The code at least doesn't abort() anymore.
I'm closing this.