<code>var self = this;</code> before the function declaration and then use
<code>self.sendPortMessage();</code> please.