Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8318435
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T21:58:20+00:00 2026-06-08T21:58:20+00:00

One of my stand-alone java applications (no sources available) picks random-available port to listen

  • 0

One of my stand-alone java applications (no sources available) picks random-available port to listen on.
At this stage I assume it uses getaddrinfo system call to obtain addresses to bind against.

Since I’m maintaining hundreds of various servers with assigned ports, the black app sometimes kicks in and pick one of ‘the assigned’ ports, which cause my small servers to fail on startup…

I’m wondering is there a way to restrict number of ports proposed by the OS?
Would be mostly interested in system config solutions,
but if there are no other solutions I’m also able to hack bind()/getaddrinfo (this would require some hits as well … )

thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-08T21:58:22+00:00Added an answer on June 8, 2026 at 9:58 pm

    You must be able to control it from proc entries – For example, here is a system wide setting :

    /proc/sys/net/ipv4/ip_local_port_range

    You can modify them. Or there may be utilities available for the same purpose.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

How does one convert a stand-alone .tlb file created in a pre-2009 version of
I have recently merged together 5 of my stand-alone projects into one project to
I have a class called XMLtoXML.java and this is one of it's methods... import
In one of my Java 6 applications I have a thread that feeds the
Environnement : Simple Java stand-alone application. AspectJ jar inside. I've two projects. The first
I've created a stand alone java application in which i need to copy files
I am developing a stand-alone java application which gathers data from around 1000 measuring
can any one tell me how to implement a standalone java client for playing
I have a java web application built on Stuts2/Google Guice/JPA. It uses hibernate as
I am going to create a java project that uses JNI. I want to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.