Defines a callback function to send global data

A callback function breaks the server IO loop at a given time interval
to run a function inside the code. A global method `wsSend(message)`
can now write to the socket.