Thank you very much, Alexandre Zia.
But I cannot find the FUNC_auth_plugin_disconnect in src/security.c
- http://git.eclipse.org/c/mosquitto/org.eclipse.mosquitto.git/tree/src/security.c?h=master
- http://git.eclipse.org/c/mosquitto/org.eclipse.mosquitto.git/tree/src/security.c?h=develop
And, using "(dis)connect" topic is good idea, but user-applications on mobile environment can be network-unconnectable suddenly. So user-application cannot send the last message, so the last message should be determine by MQTT broker.
Then I think disconnect plugin is needed still.
Where can I look for the FUNC_auth_plugin_disconnect?
Many thanks in advance.
P.S. Please apology me that I'm not good in English well, so I could mis-understand or saying using wrong wording.
-----Original Message-----
From: "Alexandre Zia"<alexandre.zia@xxxxxxxxxx>
To: "변동호"<cpascal@xxxxxxxxx>; "General development discussions for the mosquitto project"<mosquitto-dev@xxxxxxxxxxx>;
Cc:
Sent: 2015-09-17 (목) 12:31:03
Subject: Re: [mosquitto-dev] More triggers to plugin or external script.
Hi cpascal
There is a hook for disconnection,
look for : FUNC_auth_plugin_disconnect in src/security.c
You can create a plugin and implement this hook to do what you want.
However, there is an easier way to acomplish what you want, just set last will message for each user connecting to you application and make it publish in a determined topic
Then create an application to subscribe to this topic and you will receive a disconnect message from the broker whenever a user disconnects, if you put the username in the paylod you can easily identify the user.
On Thu, Sep 17, 2015 at 12:05 AM, 변동호
<cpascal@xxxxxxxxx> wrote:
Hello,
I'm trying to make general-purpose channel-chatting server for mobile devices, using mosquitto.
- Max. user limit: 100 per channel
- Users have own nicknames.
- Userlist visible for each channel.
I'm using mosquitto brokers as front-end servers, and using php REST services for userlist(redis) in the channels.
Also, I've made a client using C/C++.. Everything works well except I cannot determine the users is disconncted by network unavailablity. I want delete the user in the userlist..
I think it's very easy if mosquitto supports a trigger(auth_plugin?) on disconnect. :)
Many thanks in advance.
_______________________________________________
mosquitto-dev mailing list
mosquitto-dev@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/mosquitto-dev
--