Sorry for bit wacky title but step into problem that next test is fails.
func TestPullSocket1(t *testing.T) {
assert := asserts.New(t)
// Create pull socket
ctx, cancel := context.WithCancel(context.Background())
pull := zmq4.NewPull(ctx)
assert.NotNil(pull)
err := pull.Listen("ipc://@TestPullSocket1")
assert.NoError(err)
// Cancel and close socket
// This as well might be in time.AfterFunc with the same result!!!!
cancel()
err = pull.Close()
assert.NoError(err)
// Read out
msg, err := pull.Recv()
assert.Error(err)
_ = msg
// Final close
err = pull.Close()
_ = err
}
To me it looks like Close() should make qreader.sem.enable() as in this case qreader.addConn() is never called and qreader.read() stuck forever in q.sem.lock()
Sorry for bit wacky title but step into problem that next test is fails.
To me it looks like Close() should make qreader.sem.enable() as in this case qreader.addConn() is never called and qreader.read() stuck forever in q.sem.lock()