Deprecated: Function get_magic_quotes_gpc() is deprecated in /home/styllloz/public_html/qa-include/qa-base.php on line 1175

Warning: session_start(): Cannot start session when headers already sent in /home/styllloz/public_html/qa-include/app/users.php on line 162

Warning: Cannot modify header information - headers already sent by (output started at /home/styllloz/public_html/qa-include/qa-base.php:1175) in /home/styllloz/public_html/qa-include/app/users.php on line 1267

Warning: Cannot modify header information - headers already sent by (output started at /home/styllloz/public_html/qa-include/qa-base.php:1175) in /home/styllloz/public_html/qa-include/app/page.php on line 356
TCP proxy tear-resistant connection (with automatic reconnects) - code-flow.club | Q&A

TCP proxy tear-resistant connection (with automatic reconnects)


Warning: count(): Parameter must be an array or an object that implements Countable in /home/styllloz/public_html/qa-theme/donut-theme/qa-donut-layer.php on line 274
0 like 0 dislike
11 views
Suppose you have a server and some client. The client connects to the server over TCP. The client hates it when the connection breaks because of his imperfections, he believes that the connection, once installed, never breaks and if it breaks, it's he's dying, and you have all the work to do again.

Are there any tools ready that organizes "logically tear-resistant communication" pseudoroegneria between the client and the server? Here's how it could work:

| | | CLIENT ----> localhost:1234 | server:1234 -----> SERVER demons <=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+> demons if it breaks, then the daemon utility the client will reconnected to the demon utility server, but, importantly, when this CLIENT believes that the connection with the Server was terminated, because the CLIENT connected with the demon on localhost (a SERVER, respectively, also with a demon on his host). 


Ie the idea is that even if the connection is lost for a day (turned off and replaced the router, changed provider — in General anything), the CLIENT still continues to believe that it is connected with the Server, and no disconnection was not (but just the connection suddenly became very brake — pull to open 1 pack per day). With localhost-the connection never breaks...

PS
Please do not suggest all sorts of TCP keep-alive timeouts at the TCP level and other trash — the solution here is clearly supposed to be at a higher level than TCP (because to force the TCP connection is not torn in the case, for example, the physical replacement of the router or moving to another Internet operator). There is also no possibility of making improvements in the client and server.
by | 11 views

6 Answers

0 like 0 dislike
Please do not suggest all sorts of TCP keep-alive timeouts at the TCP level and other trash — the solution here is clearly supposed to be at a higher level than TCP (because to force the TCP connection is not torn in the case, for example, the physical replacement of the router or moving to another Internet operator). There is also no possibility of making improvements in the client and server.
Just here can help raised the vpn server on server and client to client (or Vice versa, does not matter), the connection, respectively, in this local network. At least momentarily breaks the connection (on the server changed the routing table, the openvpn did reconnect, the connection does not break), but in the long run, I just XS what other factors might interfere.
by
0 like 0 dislike
Not suitable for has not been canceled TCP timeouts.
This scheme will work if I switch to UDP that UDP in the drum, got the package or not — he has no SYN,ACK, etc... It is not connected, he stupidly sends packets.
by
0 like 0 dislike
The only solution is to write one ourselves. The logic to reconnect to the server in this case is unique. And if in fact there is no connection that it was better to just use UDP. Well, Yes, and to write a proxy in this case is not difficult.
by
0 like 0 dislike
Unfortunately, it is not so simple as it seems. In any case, for an arbitrary application protocols this task is not reliably solved. Suppose I implement a similar proxy. The gap TCP connections occurred at a certain operation send(). How do I know if I should resend the data that was in the send() or not? That is, it really is better to use, for example, UDP and UDP on top of writing some kind of a transport, which is resistant to prolonged interruptions.
by
0 like 0 dislike
Are you sure. what server and client do not exchange ping packets? I.e. the client (server) sends a packet to the server (client) and, if you do not receive a response within the specified time interval breaks the connection.
by
0 like 0 dislike
Try stunnel, it seems, is quite suitable. don't remember. is it possible to raise an unencrypted channel. Well, if you can not deliver the software on the server will have a server in front of another car to put. And so, like, should help.
by

Related questions

110,608 questions
257,186 answers
0 comments
35,181 users