I got my Java server deployed on Heroku. Im creating a server socket there and I can not find the way to set the PORT for this. I kinda see in Heroku logs a PORT that it gives me, but I dont know how to use it in my code. Thank you.
public int getPort() {
String port = System.getenv("PORT");
if (port == null || port.isEmpty()) {
port = "8888"; // default
}
return Integer.valueOf(port);
}