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 8422233
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T03:23:21+00:00 2026-06-10T03:23:21+00:00

I was reading the answer to this question: How to transfer files from one

  • 0

I was reading the answer to this question:
How to transfer files from one computer to another over the network using Java?

and I didn’t understand part of jjnguy’s answer. What should the LISTENING_PORT be? How do you decide what port to use? And what is CONNECTION_ADDRESS?

I realize these are very basic networking questions, so maybe someone can point me in the direction of a good tutorial?

  • 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-10T03:23:23+00:00Added an answer on June 10, 2026 at 3:23 am

    The Socket call has this signature

    public Socket(String host, int port)

    See documentation

    CONNECTION_ADDRESS is a string (probably) of the quad unsigned byte form (for IPV4) i.e. 192.168.0.2

    LISTENING_PORT can be any number between 0 and 65535 though numbers < 1024 or so are assigned to well known services (read up on IANA)

    Here is an example:

    If you put this in your browser address bar: 74.125.132.94:80 you should see google.

    note that in this case it is CONNECTION_ADDRESS:LISTENING_PORT (there is a separating : )

    This says connect to 74.125.132.94 on port 80 (HTTP)

    Basically every machine has an IP address (CONNECTION_ADDRESS) and the application you are creating will listen on a specific LISTENING_PORT. Dependant on what you application is doing you would assign EITHER an appropriate IANA service port or an arbitrary port number above the IANA range so…

    If you were creating a web server application for example then you would set the application to listen on port 80 as that is the standard HTTP web port

    OR

    Lets say you are creating a random game application that is serving people in your game the you would just choose a random number above 1024 i.e. 12345

    Then you would create your client and have it connect to port 12345 / 80 on what ever IP the server is located at (you can work out that server IP by running IPCONFIG (Windows) or whatever command is applicable for your servers OS environment.

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

Sidebar

Related Questions

I was reading this question, but didn't understand some part of the aix's answer
I was reading over this question and wondered if the accepted answer might also
From reading this question and answer , I understand that to clone a local
I bet that I could find the answer of this question from reading similar
After reading answer to this question: Make "make" default to "make -j 8" I
Thanks in Advance for reading and answer this question. I got button in asp
After reading this question , i saw the answer by Naveen containing a link
After reading the answer to this question , I learned that SFINAE can be
While I was reading the accepted answer of this question , I had the
I have this question after reading the answer here , what's the difference at

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.