Sunday, April 10, 2022

[SOLVED] TCP loopback connection vs Unix Domain Socket performance

Issue

Working on an Android and iOS based application which require communication with a server running in the same device. Currently using TCP loopback connection for communicating with App and Server (App written in user layer, server written in C++ using Android NDK)

I was wondering if replacing inter communication with Unix Domain socket would improve the performance?

Or in-general is there any evidence/theory that proves that Unix Domain socket would give better performance then TCP loopback connection?


Solution

Yes, local interprocess communication by unix domain sockets should be faster than communication by loopback localhost connections because you have less TCP overhead, see here.



Answered By - 0x4a6f4672
Answer Checked By - Timothy Miller (WPSolving Admin)