Commit cdf4fdd2 authored by Dennis Willers's avatar Dennis Willers 🏀

Doesn´t log error, if other end break up the connection

parent 532a5ce1
...@@ -162,7 +162,9 @@ server.on('connection',function(socket){ ...@@ -162,7 +162,9 @@ server.on('connection',function(socket){
// emits when any error occurs -> calls closed event immediately after this. // emits when any error occurs -> calls closed event immediately after this.
server.on('error',function(error){ server.on('error',function(error){
if (error !== 'Error: This socket has been ended by the other party') {
console.log('Error: ' + error); console.log('Error: ' + error);
}
}); });
//emits when server is bound with server.listen //emits when server is bound with server.listen
...@@ -253,10 +255,10 @@ client.on('data',function(data){ ...@@ -253,10 +255,10 @@ client.on('data',function(data){
// 87.78.129.86 | localhost // 87.78.129.86 | localhost
// Examples: // Examples:
// getVotes: {"map":"OkNwgzSwDLZSWSRPsUKY7EA1Cg5","http":"GET","url":"getVotes?map=OkNwgzSwDLZSWSRPsUKY7EA1Cg5"} // getVotes: {"map":"OkNwgzSwDLZSWSRPsUKY7EA1Cg5","http":"GET","url":"getVotes?map=OkNwgzSwDLZSWSRPsUKY7EA1Cg5"}
// setVotes: {"http":"POST", "map": "OkNwgzSwDLZSWSRPsUKY7EA1Cg5", "player": "Jtmn3kBnSSadky_mLNhp_A", "vote": 50} // setVote: {"http":"POST", "map": "OkNwgzSwDLZSWSRPsUKY7EA1Cg5", "player": "Jtmn3kBnSSadky_mLNhp_A", "vote": 50}
// getPlayerVote: {"map":"OkNwgzSwDLZSWSRPsUKY7EA1Cg5","http":"GET","url":"getPlayerVote?map=OkNwgzSwDLZSWSRPsUKY7EA1Cg5&player=Jtmn3kBnSSadky_mLNhp_A"} // getPlayerVote: {"map":"OkNwgzSwDLZSWSRPsUKY7EA1Cg5","http":"GET","url":"getPlayerVote?map=OkNwgzSwDLZSWSRPsUKY7EA1Cg5&player=Jtmn3kBnSSadky_mLNhp_A"}
const testClient = net.connect({host: 'localhost', port: 3000}, () => { /*const testClient = net.connect({host: '87.78.129.86', port: 3201}, () => {
console.log('connected to server!'); console.log('connected to server!');
//testClient.write('Hello World Client!\r\n'); //testClient.write('Hello World Client!\r\n');
testClient.write(JSON.stringify({"http":"POST", "map": "OkNwgzSwDLZSWSRPsUKY7EA1Cg5", "player": "Jtmn3kBnSSadky_mLNhp_A", "vote": 80})); testClient.write(JSON.stringify({"http":"POST", "map": "OkNwgzSwDLZSWSRPsUKY7EA1Cg5", "player": "Jtmn3kBnSSadky_mLNhp_A", "vote": 80}));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment