'recbuf' and the size of received data

Willem Broekema willem@REDACTED
Sat Jun 23 17:16:23 CEST 2001


I have a problem receiving tcp packets with data larger than
1024 bytes.

The connection is declared as:

   {ok, Sock} =  gen_tcp:connect(Host, Port,
              [binary, {packet, 0}, {active, true}, {recbuf, 2048}]),

And data is received with:

   receive
     {tcp, Sock, Data} -> ...
   end

I wonder why the binary object Data is truncated to 1024 bytes,
as I declared 'recbuf' to be twice that size.  Is there another
option I should use?

Thanks for your help.


- Willem




More information about the erlang-questions mailing list