Board index » delphi » Indy - UDP "Message too long"

Indy - UDP "Message too long"

I get this error on the client side when receiveing an 8 byte message header
the buffersize is 1k, tried with 8, 4, 2, ... nothing worked
buffersize on the server is now 1k, was 8, 4, 2, ...
this ise the code used

type
  TBufferHeader = packed record
    ID: Cardinal;
    DataSize: Cardinal;
  end;

const
  BufferHeaderSize = SizeOf(TBufferHeader);

function GetBufferHeader(Connection: TidUDPBase; var BufferHeader:
TBufferHeader): Boolean;overload;
begin
     Result:=false;
     if not Connection.Binding.Readable(500) then exit;
     try
        Result:=Connection.Binding.Recv(BufferHeader, BufferHeaderSize, 0) =
BufferHeaderSize;
     except
        Result:=false;
     end;
end;

I always get -1 from the Recv function
this used to work , didn't work when firewall was up
now it doesnt work even on the same machine !!!

any suggestions ?

 

Re:Indy - UDP "Message too long"


hum ... set the Clients BufferSize to 8k, servers is at 4k .. works now
I still don't get it why I received message too long when trying to receive
only 8 bytes
and only 8 bytes were sent !

Other Threads