AIX specific socket programming query
Posted
by kumar_m_kiran
on Stack Overflow
See other posts from Stack Overflow
or by kumar_m_kiran
Published on 2010-05-12T06:47:03Z
Indexed on
2010/05/15
16:14 UTC
Read the original article
Hit count: 216
Hi All,
Question 1
From SUSE man pages, I get the below details for socket connect options
If the initiating socket is connection-mode, then connect() shall attempt to establish a connection to the address specified by the address argument. If the connection cannot be established immediately and O_NONBLOCK is not set for the file descriptor for the socket, connect() shall block for up to an unspecified timeout interval until the connection is established. If the timeout interval expires before the connection is established, connect() shall fail and the connection attempt shall be aborted. If connect() is interrupted by a signal that is caught while blocked waiting to establish a connection, connect() shall fail and set errno to [EINTR], but the connection request shall not be aborted, and the connection shall be established asynchronously.
Question : Is the above contents valid for AIX OS (especially the connection time-out, timed wait ...etc)?Because I do not see it in AIX man pages (5.1 and 5.3)
Question 2
I have a client socket whose attributes are
a. SO_RCVTIMEO ,SO_SNDTIMEO are set for 5 seconds.
b. AF_INET and SOCK_STREAM.
c. SO_LINGER with linger on and time is 5 seconds.
d. SO_REUSEADDR is set.
Note that the client socket is not O_NONBLOCK.
Question : Now since O_NONBLOCK is not set and SO_RCVTIMEO and SO_SNDTIMEO is set for 5 seconds, does it mean
a. connect in NON Blocking or Blocking?
b. If blocking, is it timed blocking or "infinite" time blocking?
c. If it is infinite, How do I establish a "connect" system call which is O_BLOCKING with timeout to t secs.
Sorry if the questions are be very naive.
Thanks in advance for your input.
© Stack Overflow or respective owner