• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Paul Clapham
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Roland Mueller
  • Piet Souris
Bartenders:

How to find a portnumber in java

 
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
HI,

I want to know my socket communication port number to communicate with other system(as well as other portnumbers also) through java Application.
Nothing but client server communication.

Thanks in advance.
 
Ranch Hand
Posts: 58
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Welcom to Java,
You have to define the port of your choice having in mind that;

Port numbers in TCP/IP systems are 16-bit numbers and the values range
from 0–65535.
In practice, port numbers below 1024 are reserved for
predefined services, and you should not use them unless communicating
with one of those services (such as telnet, Simple Mail Transport
Protocol [SMTP] mail, ftp, and so on).

Client port numbers are allocated
by the host OS to something not in use, while server port numbers are
specified by the programmer, and are used to identify a particular service.

Note that for you to establish a communication,
Both client and server must agree in advance on which port to use. If the
port numbers used by the two parts of the system do not agree,
communication does not occur.
reply
    Bookmark Topic Watch Topic
  • New Topic