Delphi 2006 - 3 layers - Tsocketconnection - Tclientdataset

Asked

Viewed 82 times

2

I have an application running in 3 layers.

When the client layer does not find the server or for any other reason, correctly, I burst an error on screen, I am using Tsocketconnections and Tclientdatasets.

I just needed to deal with or even mask these errors reported from Tsocketconnection, that is, what I need is that even if an error occurs that the message is not shown on screen, currently the client-side application is already prepared to proceed after the error, but as the error is presented and this asks for iteration (click OK), the client part cannot proceed.

Thank you all.

  • You can ask the question the problem code?

  • Gypsy, thank you for your interest. But in fact there is no code with problem ... what I need is to use something that does not bring the error on screen, I tried TRY-EXCEPT but it does not work, I tried to treat also through the Exception within TRY-EXCEPT, but also did not work, what seems to me is that by the client application, whenever there is a connection error in the server application involving the Tsockettconnection the error will be shown on screen.

  • When the client makes the request on the server, it is always good to test the connection before, but if there is a connection and there is a problem on the server, has to treat a message and this message goes back to the client with the error treated, you must declare in the function parameter that is requested out sMensage: String, so when the client requests the server it expects the return.

  • Jefferson, thank you very much. When I start the process, which is long, I check the connection, and abortion if there is no connection ... my problem is when this connection falls during the process, because, the Tsocketconnection presents the error and is waiting for the OK, already treated the client part to proceed, but I am running into having to give this ok, I needed that even if giving error, nothing was presented on screen and this way the client part could follow normally (as the treatments are already made), everything I did so far could not prevent to present its error.

1 answer

1

If the idea is to collect Socket errors silently, I would use the Log4delphi.

If the idea is to take at the application level, there are paid tools like Eurekalog and Madexception who does it for you.

Or, if you prefer, you can use the resource JclDebug of jedi library, that is free.

  • 1

    Thanks Gypsy, I’ll take a look at this Log4delphi ... the idea is even to silently pick up the errors, and not leave the client part parked waiting for an OK when an error of this appears.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.