Showing results for 
Search instead for 
Did you mean: 

Named Pipes Connection Problem

Go to solution

Hi All,


I have created simple server and client VIs using .NET 4.0 to test out named pipes.  The server side creates a NamedPipeServerStream, then waits for a connection.  The client side creates a NamedPipeClientStream and then connects.  On the client side, IsConnected = True and NumberOfServerInstances = 1, indicating that it thinks it is connected.  If I close the server pipe, IsConnected changes to False and NumberOfServerInstances changes to 0, again making it look like all is fine on the Client side.  On the Server side, IsConnected always is False.  If I ignore that and just try to send a value using WriteByte, it does not get picked up by the Client ReadByte.


VIs are attached.


Any help would be greatly appreciated!



Download All
0 Kudos
Message 1 of 3
Accepted by topic author JohnEE

I don't know why the client says it's connected. Guess it is establishing a connection, and it assumes the server will connect too.


At the server side, use WaitForConnected to actually make the connection.


Then, do yourself a favor and figure out how to use Connect(timeout),  WaitForConnectionAsync and ReadASync. If you don't, LV will hang forever ("Resetting VI") when you abort the VI.


And please don't wire error wires behind nodes so it looks as they're connected (Client's Connect method)!



Message 2 of 3

Thanks so much!  That fixed it.  I will also look into those other methods; I have hung up LabView and had to end it with Task Manager. 


I know better with the error wire; I just somehow screwed that up.


Thanks again.



0 Kudos
Message 3 of 3