Was wondering a good way to capture exceptions. what i mean is.
i get error
"No connection could be made because the target machine actively refused it"
or
"Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host."
Hi,
i am not sure if I understood what you mean. There is no way to avoid that an exception will be thrown in case of an unreachable server.
What you could do is disconnecting in a finally block, and trying to reconnect and read the data again in a loop until the server is back on.
Stefan
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi there
Was wondering a good way to capture exceptions. what i mean is.
i get error
"No connection could be made because the target machine actively refused it"
or
"Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host."
Want a way to capture it/prvent the exception.
this is my current code
Hi,
i am not sure if I understood what you mean. There is no way to avoid that an exception will be thrown in case of an unreachable server.
What you could do is disconnecting in a finally block, and trying to reconnect and read the data again in a loop until the server is back on.
Stefan