[erlang-questions] TCP receive in gen_server

David N Murray dmurray@REDACTED
Wed May 12 17:07:17 CEST 2010


On May 12, David N Murray scribed:

> On May 12, David N Murray scribed:
>
> > I'm still seeing the same problem.  No data from the socket is sent to
> > handle_info unless I first send something to the socket, and then, only
> > one packet/message from the server is delivered at a time, even though
> > there are at least 3 messages pending:
>
> I figured it out.  I had to call inet:setopts(Socket, [{active, once}])
> after the gen_tcp:send/2, too.
>

I spoke too soon.  What's running fine on Linux doesn't work on Windows.
Same problem.  inet:setopts always returns ok.  inet:getopts prior to a
send returns {active, once}

Does anyone have a suggestion of some source code that implements
gen_server behavior, receiving from a socket via handle_info()?  I'm not
finding much in google.

Thanks,
Dave



More information about the erlang-questions mailing list