Answer the question
In order to leave comments, you need to log in
Pool for tcp sockets, or how to use one socket in two applications?
There is a program that works with the network. Interaction is implemented on tcp sockets.
There is a task to find a way to share a connection between two programs.
Task: open a socket in 1 application instance, launch another instance of the same application, and connect to the working socket. All this in order not to open a lot of connections, because. there is a limit on the connected server.
However, you won't be able to use fork, you need a new application instance.
I tried to search, but it was of little use, and the requests "tcp socket sharing", "tcp socket connection pool" did not give anything new and sensible.
Answer the question
In order to leave comments, you need to log in
I would make one instance a host that communicates with a remote server and the rest can receive data from it via local sockets or in some other way.
From described by you there are two questions
1) How you imagine work with odinm and the same socket at least even from different flows. Here the question is rather not how to share (let's say we already know how), but how to use it? How to read in two streams? Why shouldn't they fight each other? Well, I think the question is clear. Or maybe I didn't fully understand you and you just need IPC
2) Why is fork bad? Well, that is, you can first open the connection, and then fork?
PS And the last thing - how many connections do you have and why is it a problem to ask admins to raise the limits?
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question