When is it OK to change O_NONBLOCK mode of a socket?
- From: "jason.cipriani@xxxxxxxxx" <jason.cipriani@xxxxxxxxx>
- Date: Sun, 11 May 2008 18:24:32 -0700 (PDT)
First of all, what I want to do:
1. Create socket (will be either SOCK_STREAM/SOCK_DGRAM + PF_INET).
2. Set as nonblocking.
3. Connect with timeout (connect + select).
4. Set as blocking.
5. Other I/O stuff.
In my application, a blocking socket is more convenient, but I would
like to set it to non-blocking mode for connect() so I have control
over the timeout. Is this always OK?
Also, in general, are there any rules about when it's OK to change the
blocking/non-blocking mode of a socket? Can I just do it arbitrarily?
Thanks,
Jason
.
- Follow-Ups:
- Re: When is it OK to change O_NONBLOCK mode of a socket?
- From: Barry Margolin
- Re: When is it OK to change O_NONBLOCK mode of a socket?
- Prev by Date: Re: Address of function from shared library
- Next by Date: Re: When is it OK to change O_NONBLOCK mode of a socket?
- Previous by thread: xorg-set windowbackgroundpixmap error
- Next by thread: Re: When is it OK to change O_NONBLOCK mode of a socket?
- Index(es):
Relevant Pages
|