[ejabberd] Exmpp bot with gen_server connect_TCP problem

Alexander Kuleshov kuleshovmail at gmail.com
Wed Nov 2 13:32:51 MSK 2011


Hello,

I try to run jabber bot in ejabberd, written with exmpp.

My bot is usual gen_server remade from example:
https://github.com/onlyshk/exmpp/blob/master/examples/echo_client.erl

If i run it from terminal it's ok i see online bot in admin page. But if i
try to run it with my ejabberd module, inside in it, i get crash report:

=ERROR REPORT==== 2-Nov-2011::16:30:25 ===
** State machine <0.416.0> terminating
** Last event in was tcp_closed (for all states)
** When State == stream_opened
** Data == {state,digest,
{{jid,<<"mybot at localhost/exmpp#1320251360207273">>,
<<"mybot">>,<<"localhost">>,
<<"exmpp#1320251360207273">>},
"password"},
{0,0},
false,false,false,
[{compression,enabled},{starttls,enabled}],
"localhost","localhost",<0.415.0>,exmpp_socket,
{gen_tcp,#Port<0.5947>},
{xml_stream,
{gen_fsm,<0.416.0>},
{xml_parser,
[{max_size,infinity},
{root_depth,1},
{names_as_atom,true},
{emit_endtag,true},
{check_nss,xmpp},
{check_elems,xmpp},
{check_attrs,xmpp}],
#Port<0.5840>},
new,false,undefined},
"3244568556",undefined,<0.428.0>,undefined,undefined}
** Reason for termination =
** tcp_closed

=CRASH REPORT==== 2-Nov-2011::16:30:25 ===
crasher:
initial call: exmpp_session:init/1
pid: <0.416.0>
registered_name: []
exception exit: tcp_closed
in function gen_fsm:terminate/7
ancestors: [mybot,ejabberd_sup,<0.40.0>]
messages: []
links: []
dictionary: [{random_seed,{1320,8904,23723}}]
trap_exit: false
status: running
heap_size: 1597
stack_size: 24
reductions: 1162
neighbours:

How can i run it with ejabberd module?

Thank you.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.jabber.ru/pipermail/ejabberd/attachments/20111102/8d0da818/attachment.html>


More information about the ejabberd mailing list