Maximum Return Bytes of SOCKETS

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • firebirds98
    New Member
    • Feb 2008
    • 15

    #1

    Maximum Return Bytes of SOCKETS

    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:

    Code:
    Dim bytesSent As Integer = sender1.Send(data)
     Dim bytes(64000) As Byte
    Dim bytesRec As Int64
     
    '**** Where the problem happens
    bytesRec = sender1.Receive(bytes)
    '****
    Dim response As String = Encoding.ASCII.GetString(bytes, 0, bytesRec)
    
    Console.WriteLine("Response: " + response)
    
     writetofileCLUE(response)
  • Plater
    Recognized Expert Expert
    • Apr 2007
    • 7872

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

    Comment

    Working...