how to find process running on port in ubuntu

C++
lsof -i -P -nsudo lsof -i:8080
Source

Also in C++: