[erlang-questions] Is there size limit for socket buffer?

Edwin Fine <>
Thu Jun 19 05:12:07 CEST 2008


I assume you mean 1492 bytes, not bits. You don't show how you opened the
socket, or say what happens after 1492 bytes, so I'll assume it was opened
in passive binary mode and you only did one read.

If these assumptions are correct, you need to read the socket in a loop,
appending the data to a binary, until all the data has been received. How do
you know when all the data has been received? You need a protocol of some
sort. It could be as simple as expecting the first 4 bytes to hold the
length of the data (not very reliable), or something like
<SYN><SYN><DLE><STX>byte-stuffed data<DLE><ETX>.

Hope this helps.

2008/6/18 aicean <>:

> I'm use socket receive data from other program.When data size is over 1492
> bit,I can't get any the remaining data.
> Any one has a clue?
>
> Thanks!
>
> --
> aicean
>
>
> _______________________________________________
> erlang-questions mailing list
> 
> http://www.erlang.org/mailman/listinfo/erlang-questions
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20080618/b2de9c5d/attachment.html>


More information about the erlang-questions mailing list