-1

I wanted to use a already established TCP connection to send request and receive response

tcp4 0 0 192.168.58.72.50913 17.248.162.6.https ESTABLISHED

as you can see above, a tcp connection is already in established state, this connection is created by some other process. I being a root user wanted to use the same connection to send request and receive response. is this possible. ??? if yes, can you please tell how to do it ?

achilles
  • 1
  • 1
  • 1
    You can't. The socket endpoint is owned by that other process and does not work outside it. And in any case you will never be able to successfully multiplex either a TLS or an HTTP connection let alone an HTTPS connection. Why do you think you want to do this? What's the problem with creating your own connection? – user207421 Apr 21 '22 at 06:02
  • hmm okay, then how does connection poolers work ??? my assumptions was connection poolers holds few established connections and hands over to the process which requests for a connection and claims it back. – achilles Apr 22 '22 at 06:57

1 Answers1

0

If you mean to SHARE the connection (or FD, file descriptor) between the existing process -- that's quite dirty and not recommended.

Although there's a way to pass FD between processes (see this: Can I share a file descriptor to another process on linux or are they local to the process?), it needs target process to send its FD to you (rather than fetch the FD by yourself).