I'm trying to use .Net 3.5's NamedPipeServerStream and NamedPipeClientStream and I'm having some problems. I'm able to send one commmunication between the client and server programs but when the client attempts to connect a second time it hangs. Any idea what I'm doing wrong? SERVER CODE ----------- Imports System Imports System.IO Imports System.IO.Pipes Imports System.Threading Imports System.Windows.Forms Public Class SimServer Private Delegate Sub InvokeDelegate(ByVal text As String) Private newThread As New Thread(New ThreadStart(AddressOf PipeServer)) Private Sub PipeServer() ' Read the request from the client. Once the client has ' written to the pipe, its security token will be available. Dim pipeServer As New NamedPipeServerStream("CognexPipe", PipeDirection.InOut, 10) Dim sr As New StreamReader(pipeServer) Dim sw As New StreamWriter(pipeServer) Dim line As String Dim retline As String While (1) pipeServer.WaitForConnection() sw.AutoFlush = True While (pipeServer.IsConnected) If (sr.Peek > 0) Then line = sr.ReadLine() Me.BeginInvoke(New InvokeDelegate(AddressOf TextHandler), line) retline = "Received: " + line sw.WriteLine(retline) End If End While End While End Sub Private Sub Form3_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load newThread.Start() End Sub Private Sub Form3_Close(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.FormClosing newThread.Abort() End Sub Public Sub TextHandler(ByVal text As String) ReceivedBox.Text = text ReceivedBox.Update() End Sub End Class CLIENT CODE ----------- Imports System Imports System.IO Imports System.IO.Pipes Imports System.Threading Public Class SimClient Private Sub SendButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles SendButton.Click Dim pipeClient As New NamedPipeClientStream(".", "CognexPipe", PipeDirection.InOut) Dim sr As New StreamReader(pipeClient) Dim sw As New StreamWriter(pipeClient) Dim line As String Dim retline As String If Not pipeClient.IsConnected Then pipeClient.Connect() End If If pipeClient.IsConnected Then