Tagged: Problem, Remote Destination, studio
- This topic has 2 replies, 2 voices, and was last updated 2023-01-09 at 4:38 pm by Ariagna Bandala.
-
AuthorPosts
-
-
December 22, 2022 at 6:18 pm #3396
Hello, I already have the Studio version, I am using the remote destinations and I have identified that if the destination computer is not available, no error is generated but if it stops my application because it continues trying to access the destination, I was looking if it exists Is there a way to set a wait timer for the destination but I haven’t found it, is there a way to solve it? that is to say, for example, you can assign that it only takes 1sg to try to send the message to the destination
-
December 24, 2022 at 2:38 am #3397
Hi Ariagna,
I’m a little surprised by your statement, “no error is generated but [if] it stops my application because it continues trying to access the destination.” First, I’m assuming that the “if” was a mistake. Second, when using Remote Destinations, the typical approach is that the logger packages up the message and then sends it to the Local Dispatcher, and the Local Dispatcher sends it to the Remote Dispatcher running on the remote machine. In this case, the connection error actually occurs in the Local Dispatcher. You can see this because an error message will be recorded in the Dispatcher Log. However, the error does not stop your application.
Now, if you are bypassing the local Dispatcher and using the ConnectUsingTcp method to connect directly to a remote CodeSite Dispatcher, then if the remote dispatcher is not running, your the call to the CodeSite Send method will be blocked while trying to establish a connection to the remote dispatcher. However, in this case, an exception is raised in your app, which is one of the reason why we generally do not recommend using ConnectUsingTcp for this purpose. It was added to address another situation.
Anyway, there are a few things to consider when performing remote logging. First, you may wish to consider running the remote Dispatcher as a service, so that it cannot be easily shutdown. Another thing to consider is to also record your CodeSite messages to a local log file (in addition to the remote destination) because in the event of a network outage and the remote connection, the local log file will still be saved.
Getting back to your question if there exists a way to set a timer for accessing the destination. When using the typical process of Local Dispatcher to Remote Dispatcher, there is no function like this available because the actually remote transport is handled in the CodeSite Dispatcher executable. As for the ConnectUsingTcp approach, there is no timeout property surfaced, but the TCP message transport is made using the Indy components (e.g. TIdTcpClient), and it would be possible to set the connection timeout for the FTcpClient component in the TCodeSiteTcpConnection.ConnectToDispatcher method. However, this would require modifying the source Code.Ray
-
January 9, 2023 at 4:38 pm #3405
Thank you very much for your prompt response. I will take your recommendations into consideration. I have modified the CodeSiteLogging unit for now by adding the ConnecTimeout property to the constructor creation with a value of 1000
-
-
AuthorPosts
- You must be logged in to reply to this topic.