summaryrefslogtreecommitdiff
path: root/usr/src/man/man7m/datafilt.7m
diff options
context:
space:
mode:
Diffstat (limited to 'usr/src/man/man7m/datafilt.7m')
-rw-r--r--usr/src/man/man7m/datafilt.7m46
1 files changed, 46 insertions, 0 deletions
diff --git a/usr/src/man/man7m/datafilt.7m b/usr/src/man/man7m/datafilt.7m
new file mode 100644
index 0000000000..f74ac0b103
--- /dev/null
+++ b/usr/src/man/man7m/datafilt.7m
@@ -0,0 +1,46 @@
+.\"
+.\" This file and its contents are supplied under the terms of the
+.\" Common Development and Distribution License ("CDDL"), version 1.0.
+.\" You may only use this file in accordance with the terms of version
+.\" 1.0 of the CDDL.
+.\"
+.\" A full copy of the text of the CDDL should have accompanied this
+.\" source. A copy of the CDDL is also available via the Internet at
+.\" http://www.illumos.org/license/CDDL.
+.\"
+.\"
+.\" Copyright 2014 Ryan Zezeski
+.\" Copyright 2015 Joyent, Inc.
+.\"
+.Dd Apr 21, 2015
+.Dt DATAFILT 7M
+.Os
+.Sh NAME
+.Nm datafilt
+.Nd socket filter module for deferred TCP connections
+.Sh DESCRIPTION
+The
+.Nm datafilt
+socket filter provides deferment of
+.Xr 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
+.Xr read 2 or
+.Xr recv 3SOCKET
+will not block. It reduces unnecessary switching between user and
+kernel.
+.Sh EXAMPLES
+.Ss Example 1
+Enable deferment on the listening socket.
+.Bd -literal
+ setsockopt(lsock, SOL_FILTER, FIL_ATTACH, "datafilt", 8);
+.Ed
+.Ss Example 2
+Disable deferment on the listening socket.
+.Bd -literal
+ char filt[] = "datafilt";
+ setsockopt(lsock, SOL_FILTER, FIL_DETACH, filt, strlen(filt) + 1);
+.Ed
+.Sh SEE ALSO
+.Xr setsockopt 3SOCKET