Use disconnect command to terminate a connection to a server.
{disconnect | disc} [all]
select @variable = {expression | select_statement} [, @variable = {expression | select_statement} ...] [from table_list] [where search_conditions] [group by group_by_list] [having search_conditions] [order by order_by_list] [compute function_list [by by_list]]
disconnect exits the connection stack one at a time. To exit from all the connections, use disconnect all.
The disconnect command behaves differently in Replication Server 15.1 and earlier. In In these versions, a disconnect command terminates the gateway mode, and returns the working server status to the Replication Server that issued the first connect command. When your connection stack includes Replication Server versions 15.2, and 15.1 or earlier, and you issue a disconnect command, the show connection and show server commands may not display the expected output.
For details about disconnect, see the Replication Server Reference Manual.