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.

34 lines
1015 B

  1. .TH socket_bind4_reuse 3
  2. .SH NAME
  3. socket_bind4_reuse \- set the local IP address and port of a socket
  5. .B #include <socket.h>
  6. int \fBsocket_bind4_reuse\fP(int \fIs\fR,char \fIip\fR[4],uint16 \fIport\fR);
  8. socket_bind4_reuse sets the local IP address and TCP/UDP port of a
  9. TCP/UDP socket \fIs\fR to \fIip\fR and \fIport\fR respectively.
  10. If the IP address is, the operating system chooses a local IP
  11. address. If \fIport\fR is 0, the operating system chooses a port.
  12. Normally socket_bind4_reuse returns 0. If anything goes wrong,
  13. socket_bind4_reuse returns -1, setting errno appropriately.
  14. Unlike socket_bind4 this function will also tell the operating system
  15. that the address is to be reused soon, which turns off the normal pause
  16. before this IP and port can be bound again.
  18. #include <socket.h>
  19. int \fIs\fR;
  20. char \fIip\fR[4];
  21. uint16 \fIp\fR;
  22. \fIs\fR = socket_tcp();
  23. socket_bind4_reuse(s,ip,p);
  24. socket_connect4(s,ip,p);
  25. .SH "SEE ALSO"
  26. socket_bind6(3)