Link Search Menu Expand Document Edit GitHub


Disconnects a previously connected client.

Synopsis (without client context)

mqtt> dis   -i <identifier> 
            [-h <host>]  
            [-e <sessionExpiryInterval>] 
            [-r <reasonString>] 
            [-up <userProperties>]...

Synopsis (with client context)

Disconnects the currently active client context.

client@host>  dis   [-a]
                    [-e <sessionExpiryInterval>]
                    [-r <reasonString>]
                    [-up <userProperty>]...


OptionLong VersionExplanationDefault
-a--allDisconnect all connected clients. 
-i--identifierThe unique identifier of a client. 
-h--hostThe host the client is connected to.localhost
-e--sessionExpirySession expiry value in seconds.0 (No Expiry)
-r--reasonReason string for the disconnect 
-up--userPropertyA user property of the disconnect message. 


Connect a client which is identified by myClient and disconnect it afterwards using default settings

mqtt> con -i myClient
myClient@localhost> dis

Connect a client which is identified by myClient on specific settings and disconnect it afterwards

mqtt> con -i myClient -h
myClient@localhost> exit  # client is still connected
mqtt> dis -i myClient -h

NOTE: Besides the identifier also the hostname has to be given to uniquely identify the client. If you don’t specify these the default settings for these attributes will be used which may lead to unexpected behavior.