[erlang-questions] gen_tcp question

Joe Armstrong (TN/EAB) <>
Thu Sep 14 13:35:42 CEST 2006


  
I have a question about gen_tcp

A client does this:

	{ok, Port} = gen_tcp:connect(Host, Post, [binary,{packet,N}])
	get_tcp:send(Port, <<Bin>>)
	
The server

	calls gen_tcp:listen(Port, [binary,{packet,N}])

Then goes into a receive loop to receive messages

Questions:

     1) is <<Bin>> delivered as a single message to the server program?
        or is the packet fragmented.

     2) Does fragmentation or not depend upon N (the packet size)
         must N be > 0 for the receiver to be able to reconstruct the
         fragments (if fragmented?)

The behaviour appears not to be documented

/Joe

   




More information about the erlang-questions mailing list