When a client application is finished making requests, it ends the JUNOScript session by emitting the <request-end-session/> tag within an <rpc> tag element:
<rpc>
<request-end-session/>
</rpc>
In response, the JUNOScript server emits the <end-session/> tag enclosed in an <rpc-reply> tag element and a closing </junoscript> tag:
<rpc-reply xmlns:junos="URL">
<end-session/>
</rpc-reply>
</junoscript>
The client application waits to receive this reply before emitting its closing </junoscript> tag:
</junoscript>
For an example of the exchange of closing tags, see Closing the JUNOScript Session.
The client application can then close the SSH, SSL, or other connection to the JUNOScript server machine. Client applications written in Perl can close the JUNOScript session and connection by using the JUNOScript Perl module described in Writing Perl Client Applications. For more information, see that chapter.
Client applications that do not use the JUNOScript Perl module use the routine provided for closing a connection in the standard library for their programming language.