Differences between version 3 and previous revision of listen(2).
Other diffs: Previous Major Revision, Previous Author, or view the Annotated Edit History
Newer page: | version 3 | Last edited on Monday, March 10, 2003 2:26:30 pm | by PerryLorier | Revert |
Older page: | version 2 | Last edited on Monday, March 10, 2003 2:17:07 pm | by PerryLorier | Revert |
@@ -26,8 +26,11 @@
!!CONFORMING TO
Single Unix, 4.4BSD, POSIX 1003.1g draft. The listen(2) function call first appeared in 4.2BSD.
!!BUGS
-If the socket is of type __AF_INET__, and the backlog argument is greater than the constant SOMAXCONN (128 in Linux 2.0 & 2.2), it is silently truncated to SOMAXCONN. Don’t rely on this value in portable applications since BSD (and some BSD‐
derived systems) limit the backlog to 5.
+If the socket is of type __AF_INET__, and the backlog argument is greater than the constant __
SOMAXCONN__
(128 in Linux 2.0 & 2.2), it is silently truncated to __
SOMAXCONN__
. Don’t rely on this value in portable applications since BSD (and some BSD-
derived systems) limit the backlog to 5.
!!SEE ALSO
accept(2), connect(2), socket(2)
+
+!!DISCUSSION
+To use listen(2), you need a socket fd created with socket(2), and you probably also want to bind(2) it to a local port. So the sequence of actions you want are probably socket(2), bind(2) (optional, but recommended), listen(2), select(2) (optional), accept(2), close(2)