You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

33 lines
947 B
Groff

.TH socket_listen 3
.SH NAME
socket_listen \- attempt to make a TCP connection
.SH SYNTAX
.B #include <libowfat/socket.h>
int \fBsocket_listen\fP(int \fIs\fR,int \fIn\fR);
.SH DESCRIPTION
socket_listen prepares TCP socket \fIs\fR to accept TCP connections. It
allows a backlog of approximately \fIn\fR TCP SYNs. (On systems
supporting SYN cookies, the backlog is irrelevant.) Normally
socket_listen returns 0.
If anything goes wrong, socket_listen returns -1, setting errno
appropriately.
.SH EXAMPLE
#include <libowfat/socket.h>
int \fIs\fR;
char \fIip\fR[16];
uint16 \fIp\fR;
if ((\fIs\fR=socket_tcp6())==-1)
strerr_die2sys(111,FATAL,"unable to create TCP socket: ");
if (socket_bind6_reuse(\fIs\fR,(char *)V6any,8002,0) == -1)
strerr_die2sys(111,FATAL,"unable to bind: ");
if (socket_listen(\fIs\fR,1) == -1)
strerr_die2sys(111,FATAL,"unable to listen: ");
.SH "SEE ALSO"
socket_connect4(3), socket_connect6(3)