Why do software programs open TCP connections with themselves?

mxmaniac

Member
Dec 8, 2013
29
0
0
Why is it that so often software programs are running TCP connections with themselves? Usually in pairs, like some sort of strange loopback connection.

Looking at netstat or TCP view, I often find things like this.

my color calibration software has 2 TCP connections at all times.
local address:home, local port:5454, remote address:localhost, remote port:49166
local address:home, local port:49166, remote address:localhost, remote port:5454

Or firefox right now has
local address:home, local port:55244, remote address:localhost, remote port:55245
local address:home, local port:55245, remote address:localhost, remote port:55244
 

Eeqmcsq

Senior member
Jan 6, 2009
407
1
0
For the pairs question, I think netstat doesn't distinguish when a TCP connection is being connected to the same localhost. netstat sees an outgoing TCP connection, and an incoming TCP connection, and reports both, which is why you see connections to the same host in pairs.

If the connection had been made to a remote computer, then the local computer's netstat would display only the outgoing connection, while the remote computer's netstat would display only the incoming connection.

As for software opening TCP connections with itself, keep in mind that from netstat, the only thing you can be sure of is that the connection is to the same localhost. That doesn't mean that your color calibration app is connecting to its own app. Perhaps your color calibration app has a color calibration server that's always running in the background at port 5454. So when your color calibration app needs something from the server, it will "connect with itself", as in, it will connect to its own localhost at port 5454 to make requests from the server.
 
Last edited:

mxmaniac

Member
Dec 8, 2013
29
0
0
So that makes sense how one connection could show up as two. And it makes sense if 2 different applications were to communicate with each other like this, or a service communicating with a corresponding application. However I still don't understand why a single application would communicate with itself this way.

firefox.exe is communicating with itself, and the color calibration software is xrdd.exe, which is communicating with itself. Why the need to make a TCP connection back to itself again, rather than just read from its own memory, or otherwise exchange the info directly within itself?
 

Eeqmcsq

Senior member
Jan 6, 2009
407
1
0
I'm not sure. I've never had to open a socket to my own app before. The only reasons I can think of are:

- The app already had port 5454 opened for other reasons. A different part of the app needs this feature, so he simply opens a socket connection to itself to get at this feature.
- That part of the code was copied from some other client/server app, so the easiest way to insert the code into this app is to open a TCP socket and connect with itself.
- I did some searching online, and some programmers might use sockets to do some kind of inter-thread communications. That is, to pass info from one thread to another.

That's all I can think of for now.
 
sale-70-410-exam    | Exam-200-125-pdf    | we-sale-70-410-exam    | hot-sale-70-410-exam    | Latest-exam-700-603-Dumps    | Dumps-98-363-exams-date    | Certs-200-125-date    | Dumps-300-075-exams-date    | hot-sale-book-C8010-726-book    | Hot-Sale-200-310-Exam    | Exam-Description-200-310-dumps?    | hot-sale-book-200-125-book    | Latest-Updated-300-209-Exam    | Dumps-210-260-exams-date    | Download-200-125-Exam-PDF    | Exam-Description-300-101-dumps    | Certs-300-101-date    | Hot-Sale-300-075-Exam    | Latest-exam-200-125-Dumps    | Exam-Description-200-125-dumps    | Latest-Updated-300-075-Exam    | hot-sale-book-210-260-book    | Dumps-200-901-exams-date    | Certs-200-901-date    | Latest-exam-1Z0-062-Dumps    | Hot-Sale-1Z0-062-Exam    | Certs-CSSLP-date    | 100%-Pass-70-383-Exams    | Latest-JN0-360-real-exam-questions    | 100%-Pass-4A0-100-Real-Exam-Questions    | Dumps-300-135-exams-date    | Passed-200-105-Tech-Exams    | Latest-Updated-200-310-Exam    | Download-300-070-Exam-PDF    | Hot-Sale-JN0-360-Exam    | 100%-Pass-JN0-360-Exams    | 100%-Pass-JN0-360-Real-Exam-Questions    | Dumps-JN0-360-exams-date    | Exam-Description-1Z0-876-dumps    | Latest-exam-1Z0-876-Dumps    | Dumps-HPE0-Y53-exams-date    | 2017-Latest-HPE0-Y53-Exam    | 100%-Pass-HPE0-Y53-Real-Exam-Questions    | Pass-4A0-100-Exam    | Latest-4A0-100-Questions    | Dumps-98-365-exams-date    | 2017-Latest-98-365-Exam    | 100%-Pass-VCS-254-Exams    | 2017-Latest-VCS-273-Exam    | Dumps-200-355-exams-date    | 2017-Latest-300-320-Exam    | Pass-300-101-Exam    | 100%-Pass-300-115-Exams    |
http://www.portvapes.co.uk/    | http://www.portvapes.co.uk/    |