什么叫管道? [英] What are named pipes?

查看:274
本文介绍了什么叫管道?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

它们是什么以及它们如何工作?

What are they and how do they work?

上下文恰好是SQL Server

Context happens to be SQL Server

推荐答案

在Windows和POSIX系统上,命名管道都为在同一台计算机上运行的进程之间进行进程间通信提供了一种方法.命名管道为您提供了一种发送数据的方式,而不会导致涉及网络堆栈的性能损失.

Both on Windows and POSIX systems, named-pipes provide a way for inter-process communication to occur among processes running on the same machine. What named pipes give you is a way to send your data without having the performance penalty of involving the network stack.

就像您有一个服务器在侦听IP地址/端口上的传入请求一样,服务器也可以设置一个命名管道来侦听请求.在这两种情况下,客户端进程(或数据库访问库)都必须知道发送请求的特定地址(或管道名称).通常,存在一个常用的标准默认值(类似于HTTP的端口80,SQL Server在TCP/IP中使用端口1433; \\.\ pipe \ sql \ query用于命名管道).

Just like you have a server listening to a IP address/port for incoming requests, a server can also set up a named pipe which can listen for requests. In either cases, the client process (or the DB access library) must know the specific address (or pipe name) to send the request. Often, a commonly used standard default exists (much like port 80 for HTTP, SQL server uses port 1433 in TCP/IP; \\.\pipe\sql\query for a named pipe).

通过设置其他命名管道,您可以运行多个数据库服务器,每个服务器都有自己的请求侦听器.

By setting up additional named pipes, you can have multiple DB servers running, each with its own request listeners.

命名管道的优点是通常更快,并释放网络堆栈资源.

The advantage of named pipes is that it is usually much faster, and frees up network stack resources.

- 顺便说一句,在Windows世界中,您还可以将命名管道分配到远程计算机上-但是在这种情况下,命名管道是通过TCP/IP传输的,因此您将失去性能.使用命名管道进行本地计算机通信.

-- BTW, in the Windows world, you can also have named pipes to remote machines -- but in that case, the named pipe is transported over TCP/IP, so you will lose performance. Use named pipes for local machine communication.

这篇关于什么叫管道?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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