-
Notifications
You must be signed in to change notification settings - Fork 75
[Question]How to detect pipe(obtained from ctx->connect()) is writable? #420
Comments
A pipe is always immediately writable, and the pipe might "hold onto" your write requests for a bit until the connections are ready, but this is invisible to you. |
oh, I do hit error when write immediately. something wrong in my code? could you help take a look? My scenario is CLIENT triggers connection before SERVER starts to listen. In the write callback, sometimes CLIENT: LOG: |
Additional info for my scenario: I used same TensorPipe::Context instance to connect to multiple servers, namely I have called |
A "connection refused" means that the server isn't listening on that address/port, you should check how you're obtaining that address, it should come from the server's Listener instance. |
If I keep calling |
@Rhett-Ying I guess there will be no harm cuz message sending requires both client and server come into play. Write operation will not finish if receiver doesnt issue a read operation. So if server is not ready to issue read opreation and you call pipe->write, this operation will be stucked |
Hi,
when I get a pipe via
ctx->context(address)
, how do I know the pipe is ready for write or read? A return fromctx->connect()
does not mean the connection has been built, right? If I callpipe->write()
immediately, such write could fail as the underlying connection has not built yet.The text was updated successfully, but these errors were encountered: