Connecting Tech Pros Worldwide Forums | Help | Site Map

Maximum Return Bytes of SOCKETS

Newbie
 
Join Date: Feb 2008
Posts: 15
#1: Jan 7 '09
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:

Expand|Select|Wrap|Line Numbers
  1. Dim bytesSent As Integer = sender1.Send(data)
  2.  Dim bytes(64000) As Byte
  3. Dim bytesRec As Int64
  4.  
  5. '**** Where the problem happens
  6. bytesRec = sender1.Receive(bytes)
  7. '****
  8. Dim response As String = Encoding.ASCII.GetString(bytes, 0, bytesRec)
  9.  
  10. Console.WriteLine("Response: " + response)
  11.  
  12.  writetofileCLUE(response)
  13.  
  14.  
  15.  
  16.  
  17.  
  18.  
  19.  

Plater's Avatar
Moderator
 
Join Date: Apr 2007
Location: New England
Posts: 7,161
#2: Jan 7 '09

re: Maximum Return Bytes of SOCKETS


Could be the buffer size on the socket.
It could also come back in chunks? Just keep reading until you have it all
Reply


Similar Visual Basic .NET bytes