A better way is
Code:
$ sudo lsof -nPi | grep \:<port number>
where <port number> would be 8840, or whatever you're looking for. That will tell if there's a process bound to that port. Whether it's "open" depends on your firewall configuration:
Code:
$ sudo iptables -nL
PS the output above indicates that 8840 is only bound to IPv6 addresses. Is there a typo, first you said 8840, then 8080. Which one are you looking for?