|
-
Jan 16th, 2005, 05:02 AM
#1
Thread Starter
Addicted Member
VB.NET: Problem with too large XML data
Say when i click on "A" button, my program will receive the large XML data for "A" from the server...
1) However, i will only receive one section of data....
2) Then when i continue to click on "B" button, it will not receive "B" data
instead it will continue to receive the rest of "A" data...
My coding for receiving the data....
Code:
Dim tcpC As New TcpClient
Public Function receive() As String
Dim ascii As Encoding = Encoding.ASCII
Dim networkStream As NetworkStream
Try
networkStream = tcpC.GetStream()
Dim bytes(tcpC.ReceiveBufferSize) As Byte
networkStream.Read(bytes, 0, CInt(tcpC.ReceiveBufferSize))
Dim ret As String = ascii.GetString(bytes)
Return ret
Catch
End Try
End Function
How to solve the problem of getting large data...
Thanks
-
Jan 16th, 2005, 10:31 AM
#2
Re: VB.NET: Problem with too large XML data
Most probably, that has to do with the TCP/IP packet size (that can vary a lot) - when you receive, you don't get all the data in one packet. You should wait for the complete stream of bytes, maybe a software data length header could help you.
Cheers,
NTG
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|