gen_tcp bug ?

Claes Wikstrom <>
Fri Jun 10 15:38:56 CEST 2005



Is This a bug ? I surely consider it weird and unexpected.

Run a:srv() in one shell and then a:cli() in another?

I'd expect the call to gen_tcp:recv(Fd, 100) to return
{ok, Bin} where size(Bin) == 50 in the second call. That is
how unix read() works. As it is now, it's not good and severely
violates the "principle of least surprise"

What do you think.

I realize that the prefered mode of operation is to do

    gen_tcp:recv(Fd, 0)


But ......



/klacke

-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: a.erl
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20050610/4cf99b3b/attachment.ksh>


More information about the erlang-questions mailing list