Sending message just before closing connection in FMS
===

When I want to send a message to clients that explains the reason of disconnection just before I disconnect the client in FMS, sometimes client receives that messages, sometimes not. 

    client.invoke_js('on_disconnect', reason);
    application.disconnect(client);

How can I make sure that clients get the message?