mirror of https://github.com/mkerrisk/man-pages
recvmmsg.2: Minor fixes to Elie de Brauwer's patch
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
This commit is contained in:
parent
f2246260a9
commit
2c208a7a60
|
@ -170,20 +170,23 @@ The following program uses
|
||||||
to receive multiple messages on a socket and stores
|
to receive multiple messages on a socket and stores
|
||||||
them in multiple buffers.
|
them in multiple buffers.
|
||||||
The call returns if all buffers are filled or if the
|
The call returns if all buffers are filled or if the
|
||||||
timeout specified is expired.
|
timeout specified has expired.
|
||||||
|
|
||||||
The following snippet periodically generates UDP datagrams
|
The following snippet periodically generates UDP datagrams
|
||||||
containing a random number:
|
containing a random number:
|
||||||
.in +4n
|
.in +4n
|
||||||
.nf
|
.nf
|
||||||
.RB "$" " while true; do echo $RANDOM > /dev/udp/127.0.0.1/1234; sleep 0.25; done"
|
|
||||||
|
.RB "$" " while true; do echo $RANDOM > /dev/udp/127.0.0.1/1234; "
|
||||||
|
.B " sleep 0.25; done"
|
||||||
.fi
|
.fi
|
||||||
.in
|
.in
|
||||||
|
|
||||||
These datagrams are read by the example application which
|
These datagrams are read by the example application, which
|
||||||
can give the following output:
|
can give the following output:
|
||||||
.in +4n
|
.in +4n
|
||||||
.nf
|
.nf
|
||||||
|
|
||||||
.RB "$" " ./a.out"
|
.RB "$" " ./a.out"
|
||||||
5 messages received
|
5 messages received
|
||||||
1 11782
|
1 11782
|
||||||
|
@ -204,7 +207,7 @@ can give the following output:
|
||||||
#include <sys/socket.h>
|
#include <sys/socket.h>
|
||||||
|
|
||||||
int
|
int
|
||||||
main()
|
main(void)
|
||||||
{
|
{
|
||||||
#define VLEN 10
|
#define VLEN 10
|
||||||
#define BUFSIZE 200
|
#define BUFSIZE 200
|
||||||
|
|
Loading…
Reference in New Issue