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