简体   繁体   中英

What port number should I use

I am building a program that will create a socket and have it try and access a outside server not on the local network. For example, I would like to have it accept a IP address of say google.com and then return the hostName for the google.com IP address i would be using to do the request with.

The second program I am going to be writing is going to be doing this

Write a stream-based echo server and a client sending messages to it, and receiving back each message in turn.

For these two programs, are there a specific ports I should be using to do these specific problems?

Port numbers 0 to 1024 are reserved for privileged services and designated as well-known ports.
take a look at this link might be helpful.
https://www.webopedia.com/quick_ref/portnumbers.asp

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM