[erlang-questions] gen_tcp question

Joe Armstrong (TN/EAB) joe.armstrong@REDACTED
Thu Sep 14 14:33:35 CEST 2006


It might well be that it

   ... "seemed to do the right thing" ...

But what I want to knwo is if the gen_tcp layer is *designed* and
programmed
to only deliver packets of exactly the right length.

The fact that your packets are not fragmented might be accidental or by
design

Is this an accidental propery of do I have to add a layer of code that
does the
refragmentation - I could read the code, but that would be cheating.

Reading the code will tell me what the program actually does, and NOT
what it 
is supposed to do.

I guess Tony knows if he's reading this :-)

/Joe


> -----Original Message-----
> From: Sean Hinde [mailto:sean.hinde@REDACTED] 
> Sent: den 14 september 2006 14:22
> To: Joe Armstrong (TN/EAB)
> Cc: erlang-questions@REDACTED
> Subject: Re: [erlang-questions] gen_tcp question
> 
> Hi Joe,
> 
> I have used this technique with really quite large packets 
> and it always seemed to do the right thing.
> 
> I typically use {packet, 2} so that the other end cannot fill 
> up my machine with DoS style packets.
> 
> Sean
> 
> 
> On 14 Sep 2006, at 12:35, Joe Armstrong ((TN/EAB)) wrote:
> 
> >
> > 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
> >
> >
> >
> > _______________________________________________
> > erlang-questions mailing list
> > erlang-questions@REDACTED
> > http://www.erlang.org/mailman/listinfo/erlang-questions
> 
> 




More information about the erlang-questions mailing list