Hi I've finally got my nodejs page to run but I noticed that mobile devices immediately drop the connection if the screen is turned off.
How can my client check if it's still connected and reconnect if not (once the screen is back on)? Or is there a way to prevent the disconnect in the first place?
Are there events i could use to go off of, or would i need to use an interval to check it?
Reconnecting immediately on disconnect probably wouldn't do any good because the screen is still off and the connection would just be closed again moments after, right?
just as a baseline here are the names of my server objects:
/* Server */
const socketio = require('socket.io');
const app = express();
const server = http.createServer(app);
const io = socketio(server);
io.on('connection', socket => {
socket.on('joinRoom', ({ username, room }) => {
...
/* Client */
const socket = io();
socket.emit('joinRoom', { username, room });