DATAFILT(4M) STREAMS Modules DATAFILT(4M)

datafiltsocket filter module for deferred TCP connections

The datafilt socket filter provides deferment of accept(3SOCKET) for TCP connections. The accept call will not return until at least one byte has been buffered by the kernel. Deferment assures the application that the first call to read(2) or recv(3SOCKET) will not block. It reduces unnecessary switching between user and kernel.

Enable deferment on the listening socket.

    setsockopt(lsock, SOL_FILTER, FIL_ATTACH, "datafilt", 8);

Disable deferment on the listening socket.

    char filt[] = "datafilt";
    setsockopt(lsock, SOL_FILTER, FIL_DETACH, filt, strlen(filt) + 1);

setsockopt(3SOCKET)

April 21, 2015 OmniOS