Changeset 745 for trunk/server/source3/torture/msgtest.c
- Timestamp:
- Nov 27, 2012, 4:43:17 PM (13 years ago)
- Location:
- trunk/server
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/server
- Property svn:mergeinfo changed
/vendor/current merged: 581,587,591,594,597,600,615,618,740
- Property svn:mergeinfo changed
-
trunk/server/source3/torture/msgtest.c
r414 r745 2 2 Unix SMB/CIFS implementation. 3 3 Copyright (C) Andrew Tridgell 2000 4 4 5 5 This program is free software; you can redistribute it and/or modify 6 6 it under the terms of the GNU General Public License as published by 7 7 the Free Software Foundation; either version 3 of the License, or 8 8 (at your option) any later version. 9 9 10 10 This program is distributed in the hope that it will be useful, 11 11 but WITHOUT ANY WARRANTY; without even the implied warranty of 12 12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 13 GNU General Public License for more details. 14 14 15 15 You should have received a copy of the GNU General Public License 16 16 along with this program. If not, see <http://www.gnu.org/licenses/>. … … 22 22 23 23 #include "includes.h" 24 #include "messages.h" 24 25 25 26 static int pong_count; … … 49 50 load_case_tables(); 50 51 51 setup_logging(argv[0], True);52 52 setup_logging(argv[0], DEBUG_STDOUT); 53 53 54 lp_load(get_dyn_CONFIGFILE(),False,False,False,True); 54 55 55 56 if (!(evt_ctx = tevent_context_init(NULL)) || 56 !(msg_ctx = messaging_init(NULL, server_id_self(), evt_ctx))) {57 !(msg_ctx = messaging_init(NULL, procid_self(), evt_ctx))) { 57 58 fprintf(stderr, "could not init messaging context\n"); 58 59 exit(1); 59 60 } 60 61 61 62 if (argc != 3) { 62 63 fprintf(stderr, "%s: Usage - %s pid count\n", argv[0], … … 88 89 89 90 for (i=0;i<n;i++) { 90 messaging_send(msg_ctx, pid_to_procid(getpid()), MSG_PING,91 messaging_send(msg_ctx, messaging_server_id(msg_ctx), MSG_PING, 91 92 &data_blob_null); 92 messaging_send_buf(msg_ctx, pid_to_procid(getpid()), MSG_PING,93 (uint8 *)buf, 11);93 messaging_send_buf(msg_ctx, messaging_server_id(msg_ctx), 94 MSG_PING,(uint8 *)buf, 11); 94 95 } 95 96 … … 133 134 } 134 135 } 135 136 136 137 printf("waiting for %d remaining replies (done %d)\n", 137 138 (int)(ping_count - pong_count), pong_count); … … 142 143 } 143 144 } 144 145 145 146 if (ping_count != pong_count) { 146 147 fprintf(stderr, "ping test failed! received %d, sent " 147 148 "%d\n", pong_count, (int)ping_count); 148 149 } 149 150 150 151 printf("ping rate of %.0f messages/sec\n", 151 152 (ping_count+pong_count)/timeval_elapsed(&tv));
Note:
See TracChangeset
for help on using the changeset viewer.