[erlang-questions] Question about gen_tcp:recv

flowerstars theflowerstars@REDACTED
Tue Nov 1 21:15:19 CET 2011


Hi guys, 

I am a beginner of learning erlang. My problem is whenever I call
gen_tcp:recv, I got {error, closed} all the time. 

The procedure is as following: 

1> Opts = [list, {packet, 0}, {active, false}, {reuseaddr, true}]. 
[list,{packet,0},{active,false},{reuseaddr,true}] 
2> {ok, Sock} = gen_tcp:connect("pop.gmail.com", 995, Opts). 
{ok,#Port<0.526>} 
3> Res = gen_tcp:recv(Sock, 0). 
{error, closed} 

Is the problem about my code or about the pop server? 

Thanks so much for your reply.

--
View this message in context: http://erlang.2086793.n4.nabble.com/Question-about-gen-tcp-recv-tp3965225p3965225.html
Sent from the Erlang Questions mailing list archive at Nabble.com.



More information about the erlang-questions mailing list