Hi all, I've been attempting to connect using a mio::net::TcpStream, using the client method for a non-blocking method of connecting. The only way that I've been able to get it to work is to make it so that handshake() doesn't return an error when the error is WouldBlock. This makes sense to me, given the following from the documentation for Poll in mio.
If operation fails with WouldBlock, then the caller should not treat this as an error, but instead should wait until another readiness event is received.
And
Once a readiness event is received, the corresponding operation must be performed repeatedly until it returns WouldBlock.
Which unfortunately for me, my corresponding operation is the client call, which simply return an error in this case, and I can't really repeat, since it consumes the stream via move.
Hi all, I've been attempting to connect using a
mio::net::TcpStream
, using theclient
method for a non-blocking method of connecting. The only way that I've been able to get it to work is to make it so thathandshake()
doesn't return an error when the error isWouldBlock
. This makes sense to me, given the following from the documentation forPoll
in mio.And
Which unfortunately for me, my corresponding operation is the
client
call, which simply return an error in this case, and I can't really repeat, since it consumes the stream via move.