Maximum Return Bytes of SOCKETS

Please support our VB.NET advertiser: Intel Parallel Studio Home
Reply

Join Date: Feb 2008
Posts: 13
Reputation: firebirds98 is an unknown quantity at this point 
Solved Threads: 0
firebirds98 firebirds98 is offline Offline
Newbie Poster

Maximum Return Bytes of SOCKETS

 
0
  #1
Jan 7th, 2009
I am building an application in which sends an outside server data, it then shoots back data which pertains to what I sent. The problem that I am having is that the maximum amount of bytes tha will come back is 8001. The program works fine as long as the return byte value is less then 8001. Something with the max value sounds familiar but I can not pin point it. What else could I do to receive the rest of the data?

This code snippet is where im getting problem
  1.  
  2. Dim bytesSent As Integer = sender1.Send(data)
  3. Dim bytes(64000) As Byte
  4. Dim bytesRec As Int64
  5.  
  6. '**** Where the problem happens
  7. bytesRec = sender1.Receive(bytes)
  8. '****
  9. Dim response As String = Encoding.ASCII.GetString(bytes, 0, bytesRec)
  10.  
  11. Console.WriteLine("Response: " + response)
  12.  
  13. writetofileCLUE(response)
Reply With Quote Quick reply to this message  
Join Date: Aug 2008
Posts: 710
Reputation: Teme64 will become famous soon enough Teme64 will become famous soon enough 
Solved Threads: 115
Teme64's Avatar
Teme64 Teme64 is offline Offline
Master Poster

Re: Maximum Return Bytes of SOCKETS

 
0
  #2
Jan 10th, 2009
See ASP Net - Strange problem with System.Net.Sockets.TcpClient(). There's the same problem solved.
The point is to read data in a small blocks in a loop to a buffer, and to check how many bytes you've received in each loop.
After all the data is read, convert byte buffer to a string.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the VB.NET Forum


Views: 383 | Replies: 1
Thread Tools Search this Thread



Tag cloud for VB.NET
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC