[newbie] Erlangish way of Iterator pattern
Wed Jan 26 10:04:46 CET 2005
Gaspar Chilingarov wrote:
> as far as i can understand, there is no way to implement gen_server
> when using gen_tcp ? i stuck, because i cannot think of place, where i
> put accept() call :)
i think it can be done, if you want to.
one solution would be to put the accept/1 in another process and use
cast/2 to send the socket to the gen_server.
if you want the accept/1 in the gen_server processs the problem is that
accept/1 might block which would cause the gen_server to timeout. but
use accept/2 and have the timeout shorter than the timeout for the
More information about the erlang-questions