TCP回送连接与Unix域套接字性能 [英] TCP loopback connection vs Unix Domain Socket performance

查看:312
本文介绍了TCP回送连接与Unix域套接字性能的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在基于Android和iOS的应用程序上工作,这些应用程序需要与在同一设备上运行的服务器进行通信.当前使用TCP环回连接与App和Server通信(以用户层编写的App,使用Android NDK以C ++编写的服务器)

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)

我想知道用Unix Domain套接字替换内部通信是否可以提高性能?

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

或者总的来说,有什么证据/理论证明Unix域套接字比TCP环回连接具有更好的性能?

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

推荐答案

是的,由于您的TCP开销较小,因此通过Unix域套接字进行的本地进程间通信应比通过环回本地主机连接进行的通信更快,请参见

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.

这篇关于TCP回送连接与Unix域套接字性能的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆