send websocket message before passed callback is called.