命名管道和tcp/ip之间的区别是什么 [英] What is Difference between named pipe and tcp/ip

查看:238
本文介绍了命名管道和tcp/ip之间的区别是什么的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

命名管道与TCP/ip

解决方案

的区别是什么,它们实际上是两种进程间通信的竞争方法,例如,参见Stack Overflow上的答案 [ ^ ].


在快速局域网(LAN)环境中,传输控制协议/Internet协议(TCP/IP)套接字和命名管道客户端在性能上是可比的.但是,TCP/IP套接字和命名管道客户端之间的性能差异在较慢的网络(例如跨广域网(WAN)或拨号网络)中变得很明显.这是因为进程间通信(IPC)机制在同级之间进行通信的方式不同.

对于命名管道,网络通信通常更具交互性.一个对等方不会发送数据,直到另一个对等方使用读取命令进行请求.在开始读取数据之前,网络读取通常涉及一系列窥视命名管道消息.在慢速的网络中,这可能会非常昂贵,并导致过多的网络流量,进而影响其他网络客户端.

弄清楚您是在谈论本地管道还是网络管道,也很重要.如果服务器应用程序在运行Microsoft SQL Server™2000实例的计算机上本地运行,则可以使用本地命名管道"协议.本地命名管道以内核模式运行,并且速度非常快.

对于TCP/IP套接字,数据传输更加简化并且开销更少.数据传输还可以利用TCP/IP套接字性能增强机制,例如加窗,延迟确认等,这在慢速网络中可能非常有益.根据应用程序的类型,这种性能差异可能会很大.

TCP/IP套接字还支持积压队列,与命名管道相比,该队列提供的平滑效果有限,当您尝试连接到SQL Server时,这可能导致管道繁忙错误.

通常,在慢速的LAN,WAN或拨号网络中首选使用套接字,而在不考虑网络速度的情况下,命名管道可能是更好的选择,因为它提供了更多的功能,易用性和配置选项. /blockquote>

What is Difference between Named pipe and TCP/ip

解决方案

They are in fact two competitive approaches to inter process communication, see for instance this answer at Stack Overflow[^].


In a fast local area network (LAN) environment, Transmission Control Protocol/Internet Protocol (TCP/IP) Sockets and Named Pipes clients are comparable in terms of performance. However, the performance difference between the TCP/IP Sockets and Named Pipes clients becomes apparent with slower networks, such as across wide area networks (WANs) or dial-up networks. This is because of the different ways the interprocess communication (IPC) mechanisms communicate between peers.

For named pipes, network communications are typically more interactive. A peer does not send data until another peer asks for it using a read command. A network read typically involves a series of peek named pipes messages before it begins to read the data. These can be very costly in a slow network and cause excessive network traffic, which in turn affects other network clients.

It is also important to clarify if you are talking about local pipes or network pipes. If the server application is running locally on the computer running an instance of Microsoft SQL Server™ 2000, the local Named Pipes protocol is an option. Local named pipes runs in kernel mode and is extremely fast.

For TCP/IP Sockets, data transmissions are more streamlined and have less overhead. Data transmissions can also take advantage of TCP/IP Sockets performance enhancement mechanisms such as windowing, delayed acknowledgements, and so on, which can be very beneficial in a slow network. Depending on the type of applications, such performance differences can be significant.

TCP/IP Sockets also support a backlog queue, which can provide a limited smoothing effect compared to named pipes that may lead to pipe busy errors when you are attempting to connect to SQL Server.

In general, sockets are preferred in a slow LAN, WAN, or dial-up network, whereas named pipes can be a better choice when network speed is not the issue, as it offers more functionality, ease of use, and configuration options.


这篇关于命名管道和tcp/ip之间的区别是什么的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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