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.

40 lines
1.3 KiB

  1. .TH socket_bind6_reuse 3
  2. .SH NAME
  3. socket_bind6_reuse \- set the local IP address and port of a socket
  5. .B #include <socket.h>
  6. int \fBsocket_bind6_reuse\fP(int \fIs\fR,char \fIip\fR[16],uint16 \fIport\fR,
  7. uint32 \fIscope_id\fR);
  9. socket_bind6_reuse sets the local IP address and TCP/UDP port of a
  10. TCP/UDP socket \fIs\fR to \fIip\fR and \fIport\fR respectively.
  11. If the IP address is ::, the operating system chooses a local IP
  12. address. If \fIport\fR is 0, the operating system chooses a port.
  13. Normally socket_bind6_reuse returns 0. If anything goes wrong,
  14. socket_bind6_reuse returns -1, setting errno appropriately.
  15. The \fIscope_id\fR should normally be zero, but for link-local addresses
  16. it specifies the interface number on which to bind. The interface
  17. number for a given network interface name can be found with
  18. \fBsocket_getifidx\fR.
  19. Unlike socket_bind6 this function will also tell the operating system
  20. that the address is to be reused soon, which turns off the normal pause
  21. before this IP and port can be bound again.
  23. #include <socket.h>
  24. int \fIs\fR;
  25. char \fIip\fR[16];
  26. uint16 \fIp\fR;
  27. \fIs\fR = socket_tcp();
  28. socket_bind6_reuse(s,ip,p);
  29. socket_connect4(s,ip,p);
  30. .SH "SEE ALSO"
  31. socket_bind6(3)