実際にイベントの後に関数demandConnexionを呼び出そうとしていますが、それは私のために働いています。「this.demandeConnexionは関数ではありません。どのように私はそれを働かせることができますか?助けてください、これはコードです:イベントの呼び出し関数NodeJs
Serveur.prototype.demandConnexion = function(idZEP) {
if (this.ZP.createZE(idZEP))
{
console.log(' ==> socket : demande de creation ZE pour '+idZEP +' accepte');
}
else
{
console.log(' ==> socket : demande de creation ZE pour '+idZEP +' refuse');
}
};
Serveur.prototype.traitementSurConnection = function(socket) {
// console.log('connexion');
console.log(' ==> socket connexion');
// traitement de l'evenement DEMANDE DE CONNEXION D'UNE ZE
socket.on('connection', (function(idZEP) { this.demandConnexion(idZEP)
console.log('good')
}))