I have an application that sends messages to a q process using k() with a negative handle. I would expect this call to not block, but very rarely it does and both the application and the q process become unresponsive (the communication is bidirectional but uses async messages only).
negative handle here indicates the msg type to be sent; unlike invoking from q, using e.g. neg[h]x, it doesn't actually affect whether it would block or not. The c-api for clients doesn't use non-blocking socket calls.
Hence, I think you'd either need to run the comms in an own thread, or increase the socket buffer sizes sufficiently so a call to send does not fill the buffers.