Click here to Skip to main content
15,902,938 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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?
Posted
Updated 27-Jan-12 6:49am
v2
Comments
Sergey Alexandrovich Kryukov 26-Jan-12 14:09pm    
Any code sample?
--SA
Gbenbam 27-Jan-12 9:52am    
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?
Chuck O'Toole 28-Jan-12 17:25pm    
Please post the relevant client and server code that established the named pipe and the code that attempts the connection on both the client and server. There are lots of ways for this to fail but without your code, we'd only be guessing.

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
 
Share this answer
 
v3
Comments
Espen Harlinn 26-Jan-12 17:22pm    
5'ed!
Sergey Alexandrovich Kryukov 26-Jan-12 20:40pm    
Thank you, Espen.
--SA
Gbenbam 27-Jan-12 9:45am    
I have invested to much time and effort on this application. This particular one must be finished with pipes. I just need it to work.
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).
 
Share this answer
 
Comments
Gbenbam 27-Jan-12 9:46am    
Is there a way I can know for sure the port to open?
Gbenbam 27-Jan-12 9:48am    
If the problem is the firewall is there some way I can make the firewall allow communication with my application. This application is meant for a paying client and I cannot tell him to disable his firewall in order to use it.
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.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900