c - How to solve Connect() time-out issues on blocking socket(for SSL handshake)? -
this type of question is(with lot of variations) kinda answered but.. need blocking connect(i'm using ssl)on socket, can set time-out , maximum number of retries , necessary never lasting more t seconds.
i hope there thing can set in os(linux: ubuntu/centos) or way in code(c) w/o going ugly, artificial way select wait, timeout events added epoll close socket. thank you.
the simplest way use alarm system call before , after connect call , handle alarm signal, not best , useful way. better , recommended way use non-blocking socket , use poll or select system calls handle different stages of making connection. if don't want use non-blocking io way use alarm.
for tutorial using non-blocking sockets refer : http://developerweb.net/viewtopic.php?id=3196
for more information happens during connect call refer to: http://www.madore.org/~david/computers/connect-intr.html
Comments
Post a Comment