ioctl on socket

Hi.

How do you use ioctl() to change the socket blocking/non-blocking state?

Can this be done on an open socket while data is coming in?

TIA

Augie

Augie Henriques <augiehenriques@hotmail.com> wrote:

Hi.

How do you use ioctl() to change the socket blocking/non-blocking state?

I’d expect that would be with fcntl():

fcntl( socket_id, F_SETFD, O_NONBLOCK );

Can this be done on an open socket while data is coming in?

I’d expect so. It would affect the behaviour of the next read()/write() call
on the socket.

-David

QNX Training Services
dagibbs@qnx.com