Mirror of :pserver:cvs@cvs.fefe.de:/cvs libowfat https://www.fefe.de/libowfat/
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

39 lines
1.3 KiB

.TH socket_bind6_reuse 3
socket_bind6_reuse \- set the local IP address and port of a socket
.B #include <socket.h>
int \fBsocket_bind6_reuse\fP(int \fIs\fR,char \fIip\fR[16],uint16 \fIport\fR,
uint32 \fIscope_id\fR);
socket_bind6_reuse sets the local IP address and TCP/UDP port of a
TCP/UDP socket \fIs\fR to \fIip\fR and \fIport\fR respectively.
If the IP address is ::, the operating system chooses a local IP
address. If \fIport\fR is 0, the operating system chooses a port.
Normally socket_bind6_reuse returns 0. If anything goes wrong,
socket_bind6_reuse returns -1, setting errno appropriately.
The \fIscope_id\fR should normally be zero, but for link-local addresses
it specifies the interface number on which to bind. The interface
number for a given network interface name can be found with
Unlike socket_bind6 this function will also tell the operating system
that the address is to be reused soon, which turns off the normal pause
before this IP and port can be bound again.
#include <socket.h>
int \fIs\fR;
char \fIip\fR[16];
uint16 \fIp\fR;
\fIs\fR = socket_tcp4();