[erlang-questions] about a tcp question in erlang

zhangbo <>
Tue Mar 29 05:45:06 CEST 2011


Hi,
	Code:
	{ok, Listen} = gen_tcp:listen(80, [{packet,0},
					binary,
                                        {active, true}])

	Loop:
		receive
        		{tcp, S, Bin} ->
				...

I want to know, when a client send a message("helloworld") to server, then send another message("helloworld2"). How many messages will the server receive? (I guess 2.)  If the client send very fast, or the message is big enough, how the situation again?

When receive {tcp, S, Bin}, Bin stands for a message or maybe just a fragment of message? If the client send "hello, server", Bin maybe "hello, server", but If the message is very big, what will Bin be? and how many times will the loop receive?






More information about the erlang-questions mailing list