Friday, March 27, 2009

My Socket Experience

Non-blocking Mode


fcntl

int flags=fcntl(sockfd, F_GETFL, 0);
flags |= O_NONBLOCK;
fcntl(sockfd, F_SETFL, flags);

ioctl

int on=1;
ioctl(sockfd, FIONBIO, &on);

Raw Socket

man 7 raw

No comments: