Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Error Handling

Status
Not open for further replies.

LoneRanger123

Programmer
Dec 19, 2000
62
0
0
GB
I have a program that communicates with other programs, and I want the server to ping the other servers in case 1 of them crashes, but if one of them does crash, the Program Generates an error with could not connect, I want this, but I want to use the OnConnectionFailed event handler and not have a popup box suspend the program, as the program is looking for failed connections!
 
I like to use the try ... catch block. The problem is I don't know what OnConnectionFailed returns to use this.
James P. Cottingham

I am the Unknown lead by the Unknowing.
I have done so much with so little
for so long that I am now qualified
to do anything with nothing.
 
do just like 2ffat said:

try
{
/* insert your 'communicate with other servers' code here. whichever lines are giving you an error... */

}
catch (...)
{
/* this will catch all returned errors, so you don't have to worry about what it returns. */
} Cyprus
[noevil]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top