Print this page
8112 EOF crazier RPC daemons
Split |
Close |
Expand all |
Collapse all |
--- old/usr/src/man/man3socket/spray.3socket.man.txt
+++ new/usr/src/man/man3rpc/spray.3rpc.man.txt
1 -SPRAY(3SOCKET) Sockets Library Functions SPRAY(3SOCKET)
1 +SPRAY(3RPC) RPC Library Functions SPRAY(3RPC)
2 2
3 3
4 4
5 5 NAME
6 6 spray - scatter data in order to test the network
7 7
8 8 SYNOPSIS
9 - cc [ flag ... ] file ... -lsocket -lnsl [ library ... ]
9 + cc [ flag ... ] file ... -lsocket -lnsl -lrpcsvc [ library ... ]
10 10 #include <rpcsvc/spray.h>
11 11
12 12 bool_t xdr_sprayarr(XDR *xdrs, sprayarr *objp);
13 13
14 14
15 15 bool_t xdr_spraycumul(XDR *xdrs, spraycumul *objp);
16 16
17 17
18 18 DESCRIPTION
19 19 The spray program sends packets to a given machine to test
20 20 communications with that machine.
21 21
22 22
23 23 The spray program is not a C function interface, per se, but it can be
24 24 accessed using the generic remote procedure calling interface
25 25 clnt_call(). See rpc_clnt_calls(3NSL). The program sends a packet to
26 26 the called host. The host acknowledges receipt of the packet. The
27 27 program counts the number of acknowledgments and can return that count.
28 28
29 29
30 30 The spray program currently supports the following procedures, which
31 31 should be called in the order given:
32 32
33 33 SPRAYPROC_CLEAR
34 34 This procedure clears the counter.
35 35
36 36
37 37 SPRAYPROC_SPRAY
38 38 This procedure sends the packet.
39 39
40 40
41 41 SPRAYPROC_GET
42 42 This procedure returns the count and the amount of
43 43 time since the last SPRAYPROC_CLEAR.
44 44
45 45
46 46 EXAMPLES
47 47 Example 1 Using spray()
48 48
49 49
50 50 The following code fragment demonstrates how the spray program is used:
51 51
52 52
53 53 #include <rpc/rpc.h>
54 54 #include <rpcsvc/spray.h>
55 55 . . .
56 56 spraycumul spray_result;
57 57 sprayarr spray_data;
58 58 char buf[100]; /* arbitrary data */
59 59 int loop = 1000;
60 60 CLIENT *clnt;
61 61 struct timeval timeout0 = {0, 0};
62 62 struct timeval timeout25 = {25, 0};
63 63 spray_data.sprayarr_len = (uint_t)100;
64 64 spray_data.sprayarr_val = buf;
65 65 clnt = clnt_create("somehost", SPRAYPROG, SPRAYVERS, "netpath");
66 66 if (clnt == (CLIENT *)NULL) {
67 67 /* handle this error */
68 68 }
69 69 if (clnt_call(clnt, SPRAYPROC_CLEAR,
70 70 xdr_void, NULL, xdr_void, NULL, timeout25)) {
71 71 /* handle this error */
72 72 }
73 73 while (loop- > 0) {
74 74 if (clnt_call(clnt, SPRAYPROC_SPRAY,
75 75 xdr_sprayarr, &spray_data, xdr_void, NULL, timeout0)) {
76 76 /* handle this error */
77 77 }
78 78 }
79 79 if (clnt_call(clnt, SPRAYPROC_GET,
80 80 xdr_void, NULL, xdr_spraycumul, &spray_result, timeout25)) {
81 81 /* handle this error */
82 82 }
83 83 printf("Acknowledged %ld of 1000 packets in %d secs %d usecs\n",
84 84 spray_result.counter,
85 85 spray_result.clock.sec,
86 86 spray_result.clock.usec);
87 87
88 88
89 89 ATTRIBUTES
90 90 See attributes(5) for descriptions of the following attributes:
91 91
↓ open down ↓ |
72 lines elided |
↑ open up ↑ |
92 92
93 93
94 94
95 95 +---------------+-----------------+
96 96 |ATTRIBUTE TYPE | ATTRIBUTE VALUE |
97 97 +---------------+-----------------+
98 98 |MT-Level | Unsafe |
99 99 +---------------+-----------------+
100 100
101 101 SEE ALSO
102 - spray(1M), rpc_clnt_calls(3NSL), attributes(5)
102 + rpc_clnt_calls(3NSL), attributes(5)
103 103
104 104 NOTES
105 105 This interface is unsafe in multithreaded applications. Unsafe
106 106 interfaces should be called only from the main thread.
107 107
108 108
109 109 A spray program is not useful as a networking benchmark as it uses
110 110 unreliable connectionless transports, for example, udp. It can report a
111 111 large number of packets dropped, when the drops were caused by the
112 112 program sending packets faster than they can be buffered locally, that
113 113 is, before the packets get to the network medium.
114 114
115 115
116 116
117 - December 30, 1996 SPRAY(3SOCKET)
117 + April 13, 2017 SPRAY(3RPC)
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX