function sendEvery5seconds() {

    connection.send(`Message ${Math.random()}`)

    setTimeout(sendEvery5seconds, 5000)
}
// function to send data from server to client every 5 sec
function to send data from server to client every 5 sec
function to send data from server to client every 5 sec
function sendEvery5seconds() {
    connection.send(`Message ${Math.random()}`)
    setTimeout(sendEvery5seconds, 5000)
}
function sendEvery5seconds ( ) { connection . send ( ` ${ Math . random ( ) } ` ) setTimeout ( sendEvery5seconds , 5000 ) }
function to send data from server to client every 5 sec
function to send data from server to client every 5 sec