jaxl / JAXL

Asynchronous, non-blocking I/O, event based PHP library for writing custom TCP/IP client and server implementations. From it's previous versions, library inherits a full blown stable support for XMPP protocol stack. In v3.0, support for HTTP protocol stack was also added.
http://jaxl.readthedocs.org/
Other
379 stars 121 forks source link

How to attach jaxl daemon with jaxlctl tool #46

Open jacksun1203 opened 10 years ago

jacksun1203 commented 10 years ago

I created a jaxl instance by running echo_bot.php

php echo_bot.php myjid@xxxx pass PLAIN

it seems working well and I got below message

jaxl:188 - 2014-04-23 10:00:11 - created pid file /Volumes/Central/Users/jsun/Sites/JAXL/.jaxl/run/jaxl_74164.pid jaxl:200 - 2014-04-23 10:00:11 - dns srv lookup for myserver.com jaxl_socket_client:95 - 2014-04-23 10:00:11 - trying tcp://myserver.com:5222 jaxl 1> jaxl_socket_server:63 - 2014-04-23 10:00:11 - socket ready to accept on path unix:///path/JAXL/.jaxl/sock/jaxl_74164.sock

Next, I start jaxlctl

./jaxlctl debug unix:///Volumes/Central/Users/jsun/Sites/JAXL/.jaxl/sock/jaxl_74164.sock

But response I got is :

jaxl_socket_client:95 - 2014-04-23 10:48:23 - trying unix://unix:///Volumes/Central/Users/jsun/Sites/JAXL/.jaxl/sock/jaxl_74164.sock jaxl_socket_client:115 - 2014-04-23 10:48:23 - unable to connect unix://unix:///Volumes/Central/Users/jsun/Sites/JAXL/.jaxl/sock/jaxl_74164.sock with error no: 2, error str: No such file or directory

Did I use the wrong command?

jacksun1203 commented 10 years ago

Actually, JAXL told me the socket file was created but I can not find it under .jaxl/sock/ directory. What's the possible issue to cause this?

abhinavsingh commented 10 years ago

Sock file is created when client/component starts, deleted as they exit.

For jaxlctl debug/attach/shell functionality consult http://jaxl.readthedocs.org/en/latest/users/jaxlctl.html

jacksun1203 commented 10 years ago

But there is no "attach" option when I type "./jaxlctl help". I am using jaxl v3.0.1.

ogin2:JAXL jsun$ ./jaxlctl help Usage: ./jaxlctl command [options...]

Commands: help This help text debug Attach a debug console to a running JAXL daemon shell Open up Jaxl shell emulator

And the strange thing is the echo_bot is still running well. Why the socket file is deleted?

echo_bot:127 - 2014-04-24 01:29:06 - jacksun1203__1@myserver.com/jaxl#85c196d77d8f40cf0d7a004ae5572e1d is now available (dnd)

jacksun1203 commented 10 years ago

Hi, Now I can get the sock file. But I get below error message when trying jaxlctl debug. It complains undefined variable, client. Could you point me where I am wrong? Thanks!

$ ./jaxlctl debug .jaxl/sock/jaxl_3961 jaxl_socket_client:95 - 2014-04-30 10:39:55 - trying unix://.jaxl/sock/jaxl_3961 jaxl 2> global $client; jaxl 3> $client->send_chat_msg('myaccount@xmpp.server.com', 'Hello JAXL'); jaxl_socket_client:175 - 2014-04-30 10:40:43 - socket eof, disconnecting

jaxl 1> jaxl_exception:48 - 2014-04-30 10:40:43 - got jaxl exception construct with Undefined variable: client, 8, /to_my_path/JAXL-3.x/jaxl.php(458) : eval()'d code, 1

ghoulich commented 10 years ago

I encountered this problem too, but no one can give a solution or any useful suggestions ...