W
Winger
Hi,
I'm having a weird problem... Part of code first:
Dim bytes(tcpClient.ReceiveBufferSize) As Byte
Dim DataChunk as String
Dim FullData as String
Do While EOF = False
If networkStream.DataAvailable = True Then
networkStream.Read(bytes, 0, CInt(tcpClient.ReceiveBufferSize))
DataChunk = Encoding.ASCII.GetString(bytes)
DataChunk = Trim(DataChunk)
FullData = FullData & DataChunk
bytes.Clear(bytes, 0, CInt(tcpClient.ReceiveBufferSize))
If DataChunk="EOF,AppConfirmationString"
EOF = True
End If
End If
Loop
When a number of packets is received on the socket (e.g. client sending
data line by line rather than a single stream), FullData always equals
to whatever the first packet (line) included. It just doesn't seem to
add DataChunk to itself each time loop is run. Why?
When instead of this I try adding DataChunk to a textbox, it's fine, at
the end I have all data sent to me in textbox...
I'm having a weird problem... Part of code first:
Dim bytes(tcpClient.ReceiveBufferSize) As Byte
Dim DataChunk as String
Dim FullData as String
Do While EOF = False
If networkStream.DataAvailable = True Then
networkStream.Read(bytes, 0, CInt(tcpClient.ReceiveBufferSize))
DataChunk = Encoding.ASCII.GetString(bytes)
DataChunk = Trim(DataChunk)
FullData = FullData & DataChunk
bytes.Clear(bytes, 0, CInt(tcpClient.ReceiveBufferSize))
If DataChunk="EOF,AppConfirmationString"
EOF = True
End If
End If
Loop
When a number of packets is received on the socket (e.g. client sending
data line by line rather than a single stream), FullData always equals
to whatever the first packet (line) included. It just doesn't seem to
add DataChunk to itself each time loop is run. Why?
When instead of this I try adding DataChunk to a textbox, it's fine, at
the end I have all data sent to me in textbox...