User: " + parsed.input1;console.log(messages);res.write(postHTML);res.write(messages);});rl.on('line', function(input) {serverinput = "
Server: " + input;res.write(serverinput);messages = messages + serverinput;console.log(messages);});}).listen(8080);When I run this, it appears to work perfectly, until the user sends multiple messages without the server responding. This causes the rl.on('line') to get executed more than once. It also just happens randomly occasionally? This causes it to appear like the server had sent the same message multiple times when they had only sent it once. Does anyone know how I could fix this?
Submitted September 20, 2020 at 01:13AM by Grandmaster_Garf
No comments:
Post a Comment