source: cprs/branches/HealthSevak-CPRS/BDK32/SharedBrokerDebugger/fSharedBrokerDebugger.pas@ 1676

Last change on this file since 1676 was 829, checked in by Kevin Toppenberg, 14 years ago

Upgrade to version 27

File size: 22.5 KB
Line 
1unit fSharedBrokerDebugger;
2
3interface
4
5uses
6 Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
7 StdCtrls, OleServer, CheckLst, ComCtrls,
8 Menus, RPCSharedBrokerSessionMgr1_TLB;
9
10type
11
12 TfrmSharedBrokerDebugger = class(TForm)
13 Label1: TLabel;
14 Label2: TLabel;
15 Label3: TLabel;
16 btnExit: TButton;
17 EnableRpcCallLogForAllClientsCheckBox: TCheckBox;
18 mVistaSession: TSharedBroker;
19 CurrentClientsCheckedListBox: TCheckListBox;
20 actualBrokerConnectionsCheckedListBox: TCheckListBox;
21 RpcCallLogListBox: TListBox;
22 maxAllClientRpcLogEntriesNumericUpDown: TEdit;
23 UpDown1: TUpDown;
24 lblMaxRPCEntries: TLabel;
25 MainMenu1: TMainMenu;
26 File1: TMenuItem;
27 Exit1: TMenuItem;
28 Edit1: TMenuItem;
29 Help1: TMenuItem;
30 About1: TMenuItem;
31 CopyConnectionsLogToClipboard1: TMenuItem;
32 clientConnectionsLogRichTextBox: TRichEdit;
33 Label4: TLabel;
34 Label5: TLabel;
35 procedure FormCreate(Sender: TObject);
36 procedure FormDestroy(Sender: TObject);
37 procedure btnExitClick(Sender: TObject);
38 procedure actualBrokerConnectionsCheckedListBoxClickCheck(
39 Sender: TObject);
40 procedure Exit1Click(Sender: TObject);
41 procedure About1Click(Sender: TObject);
42 procedure CopyConnectionsLogToClipboard1Click(Sender: TObject);
43 procedure CurrentClientsCheckedListBoxClickCheck(Sender: TObject);
44 private
45 { Private declarations }
46 mClients: TList; // List of broker type clients of the server that are connected.
47 // debugger type clients are not included
48 mConnections: TList;
49 mDoingAForcedLogoutOfClients: Boolean;
50 mOnLogoutPending: Boolean;
51
52 protected
53 procedure OnClientConnectEventHandler(Sender: TObject; uniqueClientId: Integer;
54 connection: ISharedBrokerConnection);
55 procedure OnRpcCallRecordedEventHandler(Sender: TObject; uniqueRpcId: Integer);
56 procedure OnClientDisconnectEventHandler(Sender: TObject; uniqueClientId: Integer);
57 procedure OnContextChangedEventHandler(Sender: TObject; connectionIndex: Integer; var newContext: OleVariant);
58 public
59 { Public declarations }
60 procedure RebuildClientList(uniqueClientId: Integer);
61 procedure RebuildConnectionList;
62 end;
63
64const
65 kNoUniqueClientId: integer = -1;
66 KInvalidConnectionIndex: Integer = -1;
67
68var
69 frmSharedBrokerDebugger: TfrmSharedBrokerDebugger;
70 mClients: TList;
71 mConnections: TList;
72
73implementation
74
75uses
76 uClientInfo, uBrokerConnectionInfo, uRpcLogEntry, frmVistAAbout;
77
78{$R *.DFM}
79
80{
81 /// <summary>
82 /// The main entry point for the application.
83 /// </summary>
84 [STAThread]
85
86 static void Main()
87
88 Application.Run(new Form1());
89}
90{
91function TfrmSharedBrokerDebugger.OnLogoutEventHandler; integer;
92begin
93 mOnLogoutPending := true;
94 return 1;
95end;
96
97procedure TfrmSharedBrokerDebugger.OnIdleEventHandler(object sender, EventArgs e)
98begin
99 if (mOnLogoutPending) then
100 begin
101 CloseDownVistaSession();
102 if (mDoingAForcedLogoutOfClients <> true) then
103 begin
104 // Don't do an Application Exit here.
105 // Should really send a close event on the main window
106 // Exiting here causes the server to loose its connection and blow up since
107 // control doesn't return till after this application is gone, and then
108 // the pointer references on the server are bogus
109 Application.Exit();
110 end;
111 mDoingAForcedLogoutOfClients := false;
112 mOnLogoutPending := false;
113 end;
114end;
115}
116procedure TfrmSharedBrokerDebugger.OnClientConnectEventHandler(Sender: TObject; uniqueClientId: Integer;
117 connection: ISharedBrokerConnection);
118var
119 connectionTypeName: string;
120 outString: String;
121 ClientName: WideString;
122 ErrorCode: ISharedBrokerErrorCode;
123begin
124 case (connection) of
125 New:
126 connectionTypeName := 'New';
127 Shared:
128 connectionTypeName := 'Shared';
129 Debug:
130 connectionTypeName := 'Debug';
131 else
132 connectionTypeName := 'Failed';
133 end;
134
135 Assert(mVistaSession <> nil);
136
137 errorCode := mVistaSession.GetClientNameFromUniqueClientId(uniqueClientId, clientName);
138 if (errorCode = Success) then
139 begin
140 outString := 'connect ['+connectionTypeName+'] > '+clientName+' id:='+IntToStr(uniqueClientId)+FormatDateTime(' hh:nn:ss mm/dd/yy',Now);
141 clientConnectionsLogRichTextBox.Lines.Add(outString);
142 end
143 else
144 begin
145 // need to throw a debugger exception here
146 Assert(false);
147 end;
148
149 RebuildClientList(uniqueClientId);
150 RebuildConnectionList();
151end;
152
153procedure TfrmSharedBrokerDebugger.OnClientDisconnectEventHandler(Sender: TObject; uniqueClientId: Integer);
154var
155 outString: String;
156 clientName: WideString;
157 foundOne: Boolean;
158 CInfo: TClientInfo;
159 ErrorCode: ISharedBrokerErrorCode;
160 i: Integer;
161begin
162 clientName := 'ERROR';
163 foundOne := false;
164
165 Assert(mVistaSession <> nil);
166
167 errorCode := mVistaSession.GetClientNameFromUniqueClientId(uniqueClientId, clientName);
168 if (errorCode = UniqueClientIdDoesNotExist) then
169 begin
170 // General the client should be disconnected and not available any more
171 // so lets look in our local client list for the name to print dialog.
172 for i:=0 to Pred(mClients.Count) do
173 begin
174 cInfo := TClientInfo(mClients[i]);
175 if (cInfo.UniqueId = uniqueClientId) then
176 begin
177 clientName := cInfo.Name;
178 foundOne := true;
179 break;
180 end;
181 end;
182 end;
183
184 if (foundOne) then
185 begin
186 outString := 'disconnect > '+clientName+' id:='+ IntToStr(uniqueClientId) + FormatDateTime(' hh:nn:ss mm/dd/yy',Now);
187 clientConnectionsLogRichTextBox.Lines.Add(outString);
188
189 RebuildClientList(uniqueClientId);
190 RebuildConnectionList();
191 end;
192end;
193
194 /// <summary>
195 /// OnRpcCallRecordedEventHandler handles the OnRpcCallRecorded event
196 /// from the COM interface
197 /// </summary>
198 /// <param name:='uniqueRpcId'></param>
199 /// <returns></returns>
200procedure TfrmSharedBrokerDebugger.OnRpcCallRecordedEventHandler(Sender: TObject; uniqueRpcId: Integer);
201var
202 UniqueClientId: Integer;
203 Context: WideString;
204 RpcName: WideString;
205 RpcParams: WideString;
206 ClientName: WideString;
207 RpcEndDateTime: Double;
208 RpcDuration: Integer;
209 RpcResults: WideString;
210 CInfo, TempCInfo: TClientInfo;
211 LogEntry: TRpcLogEntry;
212 I: Integer;
213 ErrorCode: ISharedBrokerErrorCode;
214begin
215 cInfo:=nil;
216
217 Assert(mVistaSession <> nil);
218
219 errorCode := mVistaSession.GetRpcCallFromHistory(uniqueRpcId, uniqueClientId, context, rpcName, rpcParams, rpcResults, rpcEndDateTime, rpcDuration);
220 if (errorCode = Success) then
221 begin
222 errorCode := mVistaSession.GetClientNameFromUniqueClientId(uniqueClientId, clientName);
223 if (errorCode = Success) then
224 begin
225 for i:=0 to Pred(mClients.Count) do
226 begin
227 tempCInfo := (TClientInfo(mClients[i]));
228 if (tempCInfo.UniqueId = uniqueClientId) then
229 begin
230 cInfo := tempCInfo;
231 break;
232 end;
233 end;
234 Assert(cInfo <> nil);
235
236 logEntry := TRpcLogEntry.Create(uniqueClientId,clientName,cInfo.BrokerConnectionIndex,uniqueRpcId,rpcEndDateTime,rpcDuration,context,rpcName,rpcParams,rpcResults);
237 if (enableRpcCallLogForAllClientsCheckBox.Checked) then
238 begin
239 // If the list is full we need to delete the 0th item till we have room for one.
240 while (rpcCallLogListBox.Items.Count >= StrToInt(maxAllClientRpcLogEntriesNumericUpDown.Text)) do
241 rpcCallLogListBox.Items.Delete(0);
242
243 rpcCallLogListBox.Items.AddObject(IntToStr(logEntry.UniqueClientId),logEntry);
244 end;
245
246 cInfo.AddRpcLogEntry(LogEntry, false);
247 // (TBrokerConnectionInfo(mConnections[cInfo.BrokerConnectionIndex])).AddRpcLogEntry(logEntry,false);
248 (TClientInfo(mConnections[cInfo.BrokerConnectionIndex])).AddRpcLogEntry(logEntry,false);
249 end
250 else
251 begin
252 // Need to throw and exception here
253// Assert(false);
254 end;
255 end
256 else
257 begin
258 // Need to throw a debugger exception here
259// Assert(false);
260 end;
261end;
262
263procedure TfrmSharedBrokerDebugger.OnContextChangedEventHandler(Sender: TObject; connectionIndex: Integer; var newContext: OleVariant);
264var
265 bInfo: TBrokerConnectionInfo;
266begin
267 if (connectionIndex >=0) and (connectionIndex < mConnections.Count) then
268 begin
269 bInfo := TBrokerConnectionInfo(mConnections[connectionIndex]);
270 if (bInfo.LastContext <> newContext) then
271 begin
272 bInfo.LastContext := newContext;
273 RebuildConnectionList();
274 end;
275 end
276 else
277 Assert(false);
278end;
279{
280procedure TfrmSharedBrokerDebugger.OnClientRpcLogClosedEventHandler(object sender, EventArgs e)
281var
282 CInfo: TClientInfo;
283begin
284 cInfo := (ClientInfo)sender;
285 for i:=0 to Pred(mClients.Count) do
286 begin
287 if (cInfo.UniqueId=((ClientInfo)mClients[i]).UniqueId) then
288 begin
289 currentClientsCheckedListBox.SetItemChecked(i,false);
290 break;
291 end;
292 end;
293end;
294
295
296procedure TfrmSharedBrokerDebugger.OnConnectionRpcLogClosedEventHandler(object sender, EventArgs e)
297var
298 BInfo: TBrokerConnectionInfo;
299begin
300 bInfo := (TBrokerConnectionInfo)sender;
301 for i:=0 to Pred(mConnections.Count) do
302 begin
303 if (bInfo.ConnectionIndex = ((BrokerConnectionInfo)mConnections[i]).ConnectionIndex) then
304 begin
305 actualBrokerConnectionsCheckedListBox.SetItemChecked(i,false);
306 break;
307 end;
308 end;
309end;
310
311
312procedure TfrmSharedBrokerDebugger.SetupVistaSession;
313begin
314 if (mVistaSession = nil) then
315 begin
316 mVistaSession := TSharedBroker.Create;
317
318 ISharedBrokerEvents_OnLogoutEventHandler OnLogoutEH := new ISharedBrokerEvents_OnLogoutEventHandler(this.OnLogoutEventHandler);
319 ISharedBrokerEvents_OnClientConnectEventHandler OnClientConnectEH := new ISharedBrokerEvents_OnClientConnectEventHandler(this.OnClientConnectEventHandler);
320 ISharedBrokerEvents_OnClientDisconnectEventHandler OnClientDisconnectEH := new ISharedBrokerEvents_OnClientDisconnectEventHandler(this.OnClientDisconnectEventHandler);
321 ISharedBrokerEvents_OnRpcCallRecordedEventHandler OnRpcCallRecorededEH := new ISharedBrokerEvents_OnRpcCallRecordedEventHandler(this.OnRpcCallRecordedEventHandler);
322 ISharedBrokerEvents_OnContextChangedEventHandler OnContextChangedEH := new ISharedBrokerEvents_OnContextChangedEventHandler(this.OnContextChangedEventHandler);
323 // Set up the event handlers here.
324 mVistaSession.OnClientConnect +:= OnClientConnectEH;
325 mVistaSession.OnClientDisconnect +:= OnClientDisconnectEH;
326 mVistaSession.OnRpcCallRecorded +:= OnRpcCallRecorededEH;
327 mVistaSession.OnLogout +:= OnLogoutEH;
328 mVistaSession.OnContextChanged +:= OnContextChangedEH;
329
330 int uniqueClientId;
331
332 // string listenerPort := ListenerPort.ToString();
333 ISharedBrokerErrorCode brokerError := mVistaSession.BrokerConnect(
334 Application.ExecutablePath,
335 ISharedBrokerClient.DebuggerClient,
336 '', // server/port pair is of no meaning in the debugger
337 false, // debug mode is of no meaning in debugger
338 false, // AllowShared connection is of no meaning in debugger
339 30, // Connection time out limit
340 out uniqueClientId);
341
342 Debug.Assert(brokerError = ISharedBrokerErrorCode.Success);
343 RebuildClientList(kNoUniqueClientId);
344 RebuildConnectionList();
345 end;
346end;
347
348procedure TfrmSharedBrokerDebugger.CloseDownVistaSession;
349begin
350 if (mVistaSession <> nil) then
351 begin
352 mVistaSession.BrokerDisconnect();
353 mVistaSession.Dispose();
354 mVistaSession.Finalize();
355 mVistaSession := nil;
356 end;
357end;
358}
359procedure TfrmSharedBrokerDebugger.RebuildClientList(uniqueClientId: Integer);
360var
361 ErrorCode: ISharedBrokerErrorCode;
362 Count: Integer;
363 id: Integer;
364 Name: WideString;
365 ConnectIndex: Integer;
366 CInfo: TClientInfo;
367 i: Integer;
368 FoundIndex: Integer;
369begin
370 count := 0;
371 Assert(mVistaSession <> nil);
372
373 errorCode := mVistaSession.GetConnectedClientCount(count);
374 if (errorCode = Success) then
375 begin
376 id := kNoUniqueClientId;
377 name := '';
378 connectIndex := kInvalidConnectionIndex;
379
380 if (uniqueClientId = kNoUniqueClientId) or (count = mClients.Count) then
381 begin
382 // Hide any open RPC logger windows
383 for i:=0 to Pred(mClients.Count) do
384 (TClientInfo(mClients[i])).Visible := false;
385
386 // Scrap the current list
387 mClients.Clear();
388
389 // Scrap the listbox list
390 currentClientsCheckedListBox.Items.Clear();
391
392 for i:=0 to Pred(count) do
393 begin
394 errorCode := mVistaSession.GetClientIdAndNameFromIndex(i, id, name);
395 if (errorCode = Success) then
396 begin
397 errorCode := mVistaSession.GetActiveBrokerConnectionIndexFromUniqueClientId(id, connectIndex);
398 if (errorCode = Success) then
399 begin
400 cInfo := TClientInfo.Create(id,name,connectIndex,kRpcHistoryEnabledDefault);
401// cInfo.OnLogClosed +:= new EventHandler(OnClientRpcLogClosedEventHandler);
402 mClients.Add(cInfo);
403 currentClientsCheckedListBox.Items.Add(cInfo.Name+' connection = '+IntToStr(cInfo.BrokerConnectionIndex)+' Id = '+IntToStr(cInfo.UniqueId));
404 end;
405 end;
406 end;
407 end
408 else
409 begin
410 if (count > mClients.Count) then
411 begin
412 // We need to add a client to the list
413 errorCode := mVistaSession.GetClientNameFromUniqueClientId(uniqueClientId, name);
414 if (errorCode = Success) then
415 begin
416 errorCode := mVistaSession.GetActiveBrokerConnectionIndexFromUniqueClientId(uniqueClientId, connectIndex);
417 if (errorCode = Success) then
418 begin
419 cInfo := TClientInfo.Create(uniqueClientId,name,connectIndex,kRpcHistoryEnabledDefault);
420// cInfo.OnLogClosed +:= new EventHandler(OnClientRpcLogClosedEventHandler);
421 mClients.Add(cInfo);
422 currentClientsCheckedListBox.Items.Add(cInfo.Name+' connection = '+IntToStr(cInfo.BrokerConnectionIndex)+' Id = '+IntToStr(cInfo.UniqueId));
423 end;
424 end;
425 end
426 else if (count < mClients.Count) then
427 begin
428 // We need to delete a client from the list
429 foundIndex := -1;
430
431 for i:=0 to Pred(mClients.Count) do
432 begin
433 cInfo := TClientInfo(mClients[i]);
434 if (cInfo.UniqueId = uniqueClientId) then
435 begin
436 foundIndex := i;
437 break;
438 end;
439 end;
440 if (foundIndex <> -1) then
441 begin
442 (TClientInfo(mClients[foundIndex])).Visible := false;
443 mClients.Delete(foundIndex);
444 currentClientsCheckedListBox.Items.Delete(foundIndex);
445 end;
446 end;
447 end;
448 end;
449end;
450
451
452procedure TfrmSharedBrokerDebugger.RebuildConnectionList;
453var
454 ErrorCode: ISharedBrokerErrorCode;
455 I, IndexCount: integer;
456 BInfo: TBrokerConnectionInfo;
457 ServerIP: WideString;
458 ServerPort: Integer;
459 LastContext: WideString;
460begin
461 IndexCount := 0;
462
463 for i:=0 to Pred(mConnections.Count) do
464 (TBrokerConnectionInfo(mConnections[i])).Visible := false;
465
466 mConnections.Clear();
467 actualBrokerConnectionsCheckedListBox.Items.Clear();
468
469 Assert(mVistaSession <> nil);
470
471 errorCode := mVistaSession.GetActiveBrokerConnectionIndexCount(indexCount);
472 if (errorCode = Success) and (indexCount > 0) then
473 begin
474 serverIp := '';
475 serverPort := 0;
476 lastContext := '';
477
478 for i:=0 to Pred(indexCount) do
479 begin
480 errorCode := mVistaSession.GetActiveBrokerConnectionInfo(i, serverIp, serverPort, lastContext);
481 if (errorCode = Success) then
482 begin
483 bInfo := TBrokerConnectionInfo.Create(i,serverIp,serverPort,lastContext);
484// bInfo.OnLogClosed +:= new EventHandler(OnConnectionRpcLogClosedEventHandler);
485 mConnections.Add(bInfo);
486 actualBrokerConnectionsCheckedListBox.Items.AddObject(IntToStr(bInfo.ConnectionIndex) + ' server: '+bInfo.ConnectedServerIP+' server port: '+IntToStr(bInfo.ConnectedServerPort) + ' Last Context = ' + bInfo.LastContext, bInfo);
487 end;
488 end;
489 end;
490end;
491{
492 private void MaxAllClientRpcLogEntriesNumericUpDown_ValueChanged(object sender, System.EventArgs e)
493 begin
494 // In case the max entry value is less than the rpc log entries delete the entries
495 while (maxAllClientRpcLogEntriesNumericUpDown.Value < rpcCallLogListBox.Items.Count)
496 rpcCallLogListBox.Items.RemoveAt(0);
497 end;
498
499 private void CurrentClientsCheckedListBox_ItemCheck(object sender, System.Windows.Forms.ItemCheckEventArgs e)
500 begin
501 ClientInfo cInfo := (ClientInfo)mClients[e.Index];
502
503 if (e.NewValue = CheckState.Checked) then
504 begin
505 cInfo.Visible := true;
506 // Transfer the current list of rpc call entries from the all rpc log
507 // that correspond to this client
508 RpcLogEntry entry;
509 for i:=0 to Pred(rpcCallLogListBox.Items.Count) do
510 begin
511 entry := (RpcLogEntry)rpcCallLogListBox.Items[i];
512 if (entry.UniqueClientId = cInfo.UniqueId) then
513 cInfo.AddRpcLogEntry(entry,true);
514 end;
515 end;
516 else
517 cInfo.Visible := false;
518 end;
519
520 private void ActualBrokerConnectionsCheckedListBox_ItemCheck(object sender, System.Windows.Forms.ItemCheckEventArgs e)
521
522 private void RpcCallLogListBox_SelectedIndexChanged(object sender, System.EventArgs e)
523 begin
524 DisplayRpcEntry((RpcLogEntry)rpcCallLogListBox.Items[rpcCallLogListBox.SelectedIndex]);
525 copySelectedRpcToClipboardMenuItem.Enabled := true;
526 end;
527
528procedure TfrmSharedBrokerDebugger.DisplayRpcEntry(entry: TRpcLogEntry)
529 List: TStringList;
530begin
531 list := entry.CreateParamsDisplayString().Split('\n');
532 paramsListBox.Items.Clear();
533 foreach(string s in list)
534 paramsListBox.Items.Add(s);
535
536 resultsRichTextBox.Text := entry.CreateResultsDisplayString();
537 rpcNameOutputLabel.Text := entry.Name;
538 rpcDebugIdOutputLabel.Text := entry.UniqueId.ToString();
539 contextOutputLabel.Text := entry.Context;
540 string duration ;
541 if (entry.Duration < 1) then
542 duration := '<1ms'
543 else
544 duration := entry.Duration.ToString() + 'ms';
545 durationOutputLabel.Text := duration;
546 clientNameOutputLabel.Text := entry.ClientName;
547 clientDebugIdOutputLabel.Text := entry.UniqueClientId.ToString();
548 end;
549
550procedure TfrmSharedBrokerDebugger.copySelectedRpcToClipboardMenuItem_Click(object sender, System.EventArgs e)
551 begin
552 // Build a string and put it on the clipboard here.
553 Clipboard.SetDataObject(((RpcLogEntry)rpcCallLogListBox.SelectedItem).CreateClipboardString());
554 end;
555 end;
556end;
557}
558procedure TfrmSharedBrokerDebugger.FormCreate(Sender: TObject);
559var
560 UniqueClientId: Integer;
561 ErrMsg: WideString;
562 LoginStr: WideString;
563begin
564 LoginStr := '';
565 mClients := TList.Create;
566 mConnections := TList.Create;
567 mVistaSession.BrokerConnect(ParamStr(0),DebuggerClient,'',False,True,True,isemRaise,0,LoginStr,UniqueClientId,ErrMsg);
568 mVistaSession.OnRpcCallRecorded := OnRpcCallRecordedEventHandler;
569 mVistaSession.OnClientConnect := OnClientConnectEventHandler;
570 mVistaSession.OnClientDisconnect := OnClientDisconnectEventHandler;
571 mVistaSession.OnContextChanged := OnContextChangedEventHandler;
572 mDoingAForcedLogoutOfClients := false;
573 mOnLogoutPending := false;
574 RebuildClientList(kNoUniqueClientId);
575 RebuildConnectionList;
576end;
577
578procedure TfrmSharedBrokerDebugger.FormDestroy(Sender: TObject);
579begin
580 mClients.Free;
581 mConnections.Free;
582 mVistaSession.BrokerDisconnect;
583end;
584
585procedure TfrmSharedBrokerDebugger.btnExitClick(Sender: TObject);
586begin
587 Halt;
588end;
589
590procedure TfrmSharedBrokerDebugger.actualBrokerConnectionsCheckedListBoxClickCheck(
591 Sender: TObject);
592var
593 BInfo, BInfo2: TBrokerConnectionInfo;
594 Entry: TRpcLogEntry;
595 CurrVal: Integer;
596 i: Integer;
597begin
598 CurrVal := actualBrokerConnectionsCheckedListBox.ItemIndex;
599 bInfo := (TBrokerConnectionInfo(mConnections[CurrVal]));
600 bInfo2 := TBrokerConnectionInfo(actualBrokerConnectionsCheckedListBox.Items.Objects[CurrVal]);
601
602 if (actualBrokerConnectionsCheckedListBox.Checked[CurrVal]) then
603 begin
604 bInfo.Visible := true;
605 // Transfer the current list of rpc call entries from the all rpc log
606 // That correspond to this connection
607 for i:=0 to Pred(rpcCallLogListBox.Items.Count) do
608 begin
609 entry := (TRpcLogEntry(rpcCallLogListBox.Items.Objects[i]));
610 if (entry.ConnectionIndex = bInfo2.ConnectionIndex) then
611// if (entry.ConnectionIndex = ActualBrokerConnectionsCheckedListBox.Items[CurrVal]) then
612 TBrokerConnectionInfo(mConnections[CurrVal]).AddRpcLogEntry(entry,true);
613 end;
614 end
615 else
616 bInfo.Visible := false;
617end;
618
619procedure TfrmSharedBrokerDebugger.Exit1Click(Sender: TObject);
620begin
621 Halt;
622end;
623
624procedure TfrmSharedBrokerDebugger.About1Click(Sender: TObject);
625begin
626 ShowAboutBox;
627end;
628
629procedure TfrmSharedBrokerDebugger.CopyConnectionsLogToClipboard1Click(
630 Sender: TObject);
631begin
632 clientConnectionsLogRichTextBox.SelectAll;
633 clientConnectionsLogRichTextBox.CopyToClipboard;
634end;
635
636procedure TfrmSharedBrokerDebugger.CurrentClientsCheckedListBoxClickCheck(
637 Sender: TObject);
638var
639 CInfo: TClientInfo;
640 Entry: TRpcLogEntry;
641 CurrVal: Integer;
642 i: Integer;
643 listobjUniqueClientID: Integer;
644begin
645 CurrVal := CurrentClientsCheckedListBox.ItemIndex;
646 CInfo := (TClientInfo(mclients[CurrVal]));
647 listobjUniqueClientId := CInfo.UniqueId;
648
649 if (CurrentClientsCheckedListBox.Checked[CurrVal]) then
650 begin
651 CInfo.Visible := true;
652 // Transfer the current list of rpc call entries from the all rpc log
653 // That correspond to this connection
654 for i:=0 to Pred(rpcCallLogListBox.Items.Count) do
655 begin
656 entry := (TRpcLogEntry(rpcCallLogListBox.Items.Objects[i]));
657 if (entry.UniqueClientId = listobjUniqueClientId) then
658// if (entry.ConnectionIndex = ActualBrokerConnectionsCheckedListBox.Items[CurrVal]) then
659 TClientInfo(mClients[CurrVal]).AddRpcLogEntry(entry,true);
660 end;
661 end
662 else
663 CInfo.Visible := false;
664end;
665
666end.
Note: See TracBrowser for help on using the repository browser.