Write ping messages to keep connection alive
Add function for user detection