MikeWiz628
Programmer
I'm receiving a stream from a socket that I opened and I'm cycling until the buffer size is 0.
However I'm getting the green bar with the message "this code has called into another function".
I know the string is finished because the pipe symbol is at the end, however, I can't leave the loop.
Here's the snippet:
' Receive the TcpServer.response.
' Buffer to store the response bytes.
data = New [Byte](1024) {}
' String to store the response ASCII representation.
Dim responseData As [String] = [String].Empty
' Read the first batch of the TcpServer response bytes.
Dim bytes As Integer = stream.Read(data, 0, data.Length)
Do while bytes > 0
responseData = System.Text.Encoding.ASCII.GetString(data, 0, bytes)
Console.WriteLine("Received: {0}", responseData)
bytes = stream.Read(data, 0, data.Length)
Loop
' Close everything.
stream.Close()
client.Close()
Any idea why it's hanging?
Thanks in advance!
However I'm getting the green bar with the message "this code has called into another function".
I know the string is finished because the pipe symbol is at the end, however, I can't leave the loop.
Here's the snippet:
' Receive the TcpServer.response.
' Buffer to store the response bytes.
data = New [Byte](1024) {}
' String to store the response ASCII representation.
Dim responseData As [String] = [String].Empty
' Read the first batch of the TcpServer response bytes.
Dim bytes As Integer = stream.Read(data, 0, data.Length)
Do while bytes > 0
responseData = System.Text.Encoding.ASCII.GetString(data, 0, bytes)
Console.WriteLine("Received: {0}", responseData)
bytes = stream.Read(data, 0, data.Length)
Loop
' Close everything.
stream.Close()
client.Close()
Any idea why it's hanging?
Thanks in advance!