[Icecast-dev] libnet: sock_connected insists on a timeout
Brendan Cully
brendan
Sun Jul 25 18:48:19 PDT 2004
While working on integrating nonblocking IO into libshout, I noticed
that sock_connected cannot be called without blocking. If I read it
right, a timeout of zero will cause the call to block until the socket
is connected. So, my questions:
1. Am I reading this right?
2. How should I poll a pending connection?
I'd prefer to have a zero timeout act as a poll, but I don't know if
any other code is relying on the current semantics. If so, I guess I'd
have to add another interface. We could specify -1 to mean block
indefinitely, but I don't really see why we'd want to do that on a
nonblocking socket to begin with. Maybe if someone decided during
connect to switch to blocking I/O, but that's a stretch.
-b
More information about the Icecast-dev
mailing list