P
P
Pavel2021-08-18 13:23:16
C++ / C#
Pavel, 2021-08-18 13:23:16

How to get a response when the connection is broken?

Good afternoon. Tell me such a moment, I send a POST request via HttpWebRequest and ran into such a problem that after sending the request, the response comes in 3-5 seconds, and if at that moment there is a connection break, then I fly into an Exception, which is logical.
Therefore, a couple of questions appeared:
1) Is it possible even if the connection is broken to restore it and get an answer?
2) Is it possible, when a connection is broken, to restore it and check the sending?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
Developer, 2021-08-18
@electronik777

1) Is it possible even if the connection is broken to restore it and get an answer?

No
2) Is it possible, when a connection is broken, to restore it and check the sending?

connection needs to be created again.
And here sending of request it is necessary to think out. Usually done through caching or other mechanisms

A
Alexander Ananiev, 2021-08-18
@SaNNy32

If the connection is broken after the request, you must reconnect and resend the request.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question