Socket.io remove listener after being executed
<p>I want to create a listener on a socket.  Then once the listener has been executed, I want the listener to stop listening.  I used this SO:</p>

<p><a href="https://stackoverflow.com/questions/23092624/socket-io-removing-specific-listener">socket.io Removing specific listener</a></p>

<p>But I cannot figure out how to have a listener destroy itself.  This is what I am thinking:</p>

<pre><code>var ListenEventFunc = function() {
    /* Do some important stuff */
    socket.removeListener('ListenEvent',ListenEventFunc);
}

socket.on('ListenEvent',ListenEventFunc);
</code></pre>

<p>What is the correct/best way to do this?  Is there anyway I can use the <code>this</code> keyword to specify the function.</p>