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.
 
 
 
 

32 lines
893 B

  1. .TH socket_send4 3
  2. .SH NAME
  3. socket_send4 \- send a UDP datagram
  4. .SH SYNTAX
  5. .B #include <socket.h>
  6. int \fBsocket_send4\fP(int \fIs\fR, const char* \fIbuf\fR, unsigned int \fIlen\fR,
  7. const char \fIip\fR[4],uint16 \fIport\fR);
  8. .SH DESCRIPTION
  9. socket_send4 sends \fIlen\fR bytes starting at \fIbuf\fR in a UDP
  10. datagram over the socket \fIs\fR to UDP port \fIport\fR on IP address
  11. \fIip\fR.
  12. You can call socket_send4 without calling socket_bind4. This has the
  13. effect as first calling socket_bind4 with IP address 0.0.0.0 and port 0.
  14. .SH RETURN VALUE
  15. socket_send4 returns 0 if the datagram was sent successfully. If not,
  16. it returns -1 and sets errno appropriately.
  17. .SH EXAMPLE
  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(s,ip,p);
  24. socket_send4(s,"hello, world",12,ip,p);
  25. .SH "SEE ALSO"
  26. socket_send6(3)