use your own constants MAX_PORT etc