我需要有关命名管道的帮助 [英] I need help with named pipes

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

问题描述

请谁能告诉我为什么我的使用命名管道进行通信的客户端/服务器应用程序在客户端和服务器应用程序都在同一台计算机上时都能很好地运行,并且都报告客户端无法连接到服务器和服务器应用程序位于不同的计算机上.我将每个客户端和服务器应用程序都设置为它们各自计算机上的传入连接的例外.我在Windows XP上对其进行了测试.


我还必须添加一些可能会有所启发的东西.服务器版本在带有密码的Windows帐户中运行.可能会出现密码问题吗?是名称管道不能跨密码帐户进行通信吗?如果是这种情况,命名管道必须满足什么条件才能跨密码帐户进行通信?


创建或连接到命名管道时,SECURITY_ATTRIBUTE值的空值可以阻止网络访问吗?

Please who can tell me why my client/server application, that uses named pipes for communication,functions perfectly well when both client and server application are on the same computer both reports that the client could not connect to the server when the client and server applications are on different computers. I made each of the client and server application an exception to in-comming connection on their respective computers.I tested them on windows XP.


There is something more I must add that may throw light. The server version was run in a pass-worded windows account. Could the presence of a password be the problem? Is it that names pipes cannot communicate across pass worded accounts?If that is the case , what condition must be satisfied for named pipes to communicate across pass worded accounts?


Can a null value for the value of SECURITY_ATTRIBUTE while creating or connecting to a named pipe prevent network access?

推荐答案

当然,命名管道根据Microsoft文档,可以通过网络进行访问:
http://msdn.microsoft.com/zh-我们/library/windows/desktop/aa365590%28v=vs.85%29.aspx [ http://en.wikipedia.org/wiki/Network_socket [ http://msdn.microsoft.com/zh-我们/library/windows/desktop/ms740673%28v=vs.85%29.aspx [ http://technet.microsoft.com/en-us/library/cc958787.aspx [ ^ ].

与Windows命名管道相反,套接字通信可以在多平台上完成,即使您仅在Windows上工作,这也非常重要.谁知道您不久的将来会面对什么要求?

—SA
Of course, named pipes can be accessible through a network, according to Microsoft documentation:
http://msdn.microsoft.com/en-us/library/windows/desktop/aa365590%28v=vs.85%29.aspx[^].

If you failed to achieve that kind of communication, I cannot say why, because my access to your hard drive is somewhat limited. :-)

However, the real question is this: is it practical to use this communication possibility or not? I don''t think it is practical, unless you already have some legacy code which is heavily based on named pipes and you need to extend the existing well-working functionality from local to network communication.

The problem is that the pipes are accessed remotely indirectly, through an additional system network service which somehow relays the pipe to the network stream. I don''t think this is good for performance. (However, I much admit I never compared.)

There is one much more important problem with named pipes: if you implement network functionality, it would not be good enough to make your system heterogeneous, working with hosts using different software platforms. Please see below.

For new development, I think it''s much better to develop communication based on sockets and Internet protocols, or some class libraries based on sockets:
http://en.wikipedia.org/wiki/Network_socket[^],
http://msdn.microsoft.com/en-us/library/windows/desktop/ms740673%28v=vs.85%29.aspx[^],
http://technet.microsoft.com/en-us/library/cc958787.aspx[^].

In contrast to Windows named pipes, socket communications can be done multiplatform, which is very important even if you work only on Windows. Who knows what requirements can you face in near future?

—SA


问题最有可能是防火墙(因为在本地您说它可以工作).尝试在两台PC上都禁用防火墙,看看是否可行.

我认为要打开的端口是445(不确定).
Most likely the problem is the firewall (because locally you say it works). Try disabling the firewall in both PCs and see if that works.

I think the port to open is 445 (not sure about that).


在密码帐户中创建管道不会引起您的问题.

SECURITY_ATTRIBUTE可能是您问题的一部分.

要连接到服务器上的管道,您在工作站上的用户登录名需要具有服务器上的权限,或者您需要使用可以由服务器和工作站共享的SECURITY_ATTRIBUTE.

例如,如果您要在本地登录到工作站,则将不太可能连接到服务器,因为将使用服务器未知的用户名进行身份验证.

如果您使用的是域登录名,请确保您具有对服务器的访问权限.

有关管道和安全性的更多信息,请此处.
Creating the pipe in a passworded account won''t cause your issue.

The SECURITY_ATTRIBUTE could be part of your problem.

To connect to a pipe on the server, your user login on the workstation would need to have rights on the server, or you would need to use a SECURITY_ATTRIBUTE that can be shared by the server and workstations.

If for instance, you''re doing a local login to your workstation, then you''ll be unlikely to be able to connect to the server because you will be authenticating with a user name unknown to the server.

If you''re using a domain login, then be sure that you have access rights to the server.

More on pipes and security can be found here.


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

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