[erlang-questions] gen_fsm:reply causes function_clause error

Andrew Thompson <>
Wed Feb 22 21:16:51 CET 2012


On Wed, Feb 22, 2012 at 02:51:23PM -0500, Kaiduan Xie wrote:
> Hi,
> 
> When does gen_fsm:reply trigger a function_clause error?
> 
> ** Reason for termination =
> ** {function_clause,
>        [{gen_fsm,reply,
>             [<0.124.0>,
>              {recvd_connection_bind,
>                  <<0,11,0,20,33,18,164,66,142,233,218,71,198,31,64,0,0,0,0,
>                    1,128,34,0,8,101,114,108,115,116,117,114,110,0,42,0,4,0,
>                    1,143,199>>}]},
> 
> gen_fsm is called in handle_info({tcp, Data}, StateName, State) callback.
> 
You only use gem_fsm:reply to do a manual reply for a synchronous
message where the 'From' is a ref/pid tuple that identifies the sync
message. It looks like you're trying to use it with just a pid as the
first argument.

Andrew



More information about the erlang-questions mailing list