XmlTextReader using NetworkStream
Visual Basic
1
Posts
1
Posters
0
Views
1
Watching
-
Hi, I am currently trying to read xml over a socket using a TcpClient. Unfortunately my client hangs, when I try to read from the stream: Dim client as TcpClient Dim reader as XmlTextReader Dim addr as IPAddress = IPAddress.Parse("127.0.0.1") client = New TcpClient client.Connect(addr, 5000) reader = New XmlTextReader( client.GetStream() ) while (reader.Read()) ' <=== here my code stops [...] The last line, is where my code stops when I send a document. After sending it a second time, the code runs again and of course receives the document twice. The same appears when I close the socket which I don't want to do. Any ideas? Kind Regards, Michael