473,785 Members | 2,412 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

finding port number

553 Contributor
How to find the port number for your PC ?

i am writing a code which will send a message to some other machine.

now just need to know the port number to use !!

Thanks
Aug 1 '07 #1
5 27666
manoj2814
5 New Member
How to find the port number for your PC ?
Aug 6 '07 #2
questionit
553 Contributor
dont know

port number is required.. if i write a code in C/C++ to send a message to another PC. i would need a port number as well.. which one that would be? and how will i get it

How to find the port number for your PC ?
Aug 6 '07 #3
Rabbit
12,516 Recognized Expert Moderator MVP
A port is an endpoint of communication. I think it can be anything between 1 and 65k. Some of those numbers are reserved. Others are free to use. It is up to YOU to decide which port number you want to use. This means that you need to write a client and server software that monitors/sends data to that port. It's not simply finding out what port number a computer is. That's not what ports are. A computer has tens of thousands of ports. Port is a misnomer because it's not a physical thing. So, which port number do you use? Whatever number you want to use that's not already in use by another program. Pick a number, any number. You just have to write the code that will read from or send data to that port.
Aug 6 '07 #4
yahiama
1 New Member
A port is an endpoint of communication. I think it can be anything between 1 and 65k. Some of those numbers are reserved. Others are free to use. It is up to YOU to decide which port number you want to use. This means that you need to write a client and server software that monitors/sends data to that port. It's not simply finding out what port number a computer is. That's not what ports are. A computer has tens of thousands of ports. Port is a misnomer because it's not a physical thing. So, which port number do you use? Whatever number you want to use that's not already in use by another program. Pick a number, any number. You just have to write the code that will read from or send data to that port.

I'm interested in that point too.I know that the printer takes port no. 1 ( I mean the LPT1 port) and I think that LPT2....Serial 1 ....all have a predetermined port no.in c++..
I add my voice to the post...what are the port no. for serial ports and network adaptors..modem s and so on
Sep 12 '07 #5
Cyberdyne
627 Recognized Expert Contributor
For a list of open ports on Windows you can go to a command prompt and enter:

netstat -an

then hit Enter

Cyberdyne
Sep 14 '07 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

21
15729
by: Alexander N. Spitzer | last post by:
If I have a machine with 3 virtual IP addresses (192.168.1.), how can I start 3 instances of the same RMI application (each started with different properties/configs), each listening on the port 1234, but each instance binds to a different ip address. that is to say: instance #1 binds to 192.168.1.5/port 1234 instance #2 binds to 192.168.1.6/port 1234 instance #3 binds to 192.168.1.7/port 1234
0
2287
by: Helge Jensen | last post by:
Having posted in microsoft.public.dotnet.framework.sdk and microsoft.public.dotnet.framework.wmi without receiving any response, I posthere on the off-chance that someone who isn't following those groups knows a solution. I'm using code (roughly like): using System; using System.Management; public class Foo {
5
4043
by: Jason | last post by:
After a server accepts a client connection on a certain port, a new socket is created on the server on a system managed dynamic port to handle the connection. Please confirm this. If so, how can I get the number of the dynamic port in the server (in server code)? Using LocalEndPoint.Port just returns the original listener port number. Thanks,
3
2678
by: MLH | last post by:
I found some code Dev Ashish posted nearly a decade ago in response to someone's inquiry describing their need to dial a number, monitor call progress and determine whether it was busy. This was back when A2.0 was more widely used, so the code is Access Basic. Autodialer is not the answer, as it requires users to take handsets off-hook manually. I find myself in need of more direct control of a voice/data/fax modem from an A97 program....
1
2973
by: wobbles | last post by:
Hi Everyone, I have a server which reads information from a "server.exe.config" file and a client that also reads from its "client.exe.config" file. If the server location or the port number changes I'd like to write (using streamwriter) a new config file for the client app. So I have a few questions: 1. Is "writing" my own config file (for the client) a bad approach. If
6
10328
by: pekspro | last post by:
I need some code that gets the address from a server. I read somewhere that you could do this by starting some broadcast server using UDP. The client should send an broadcast message, and when the server answering the client gets the address. But how do I implement this? I did this simple quick-hack: Server: Socket server = new Socket(AddressFamily.InterNetwork, SocketType.Dgram, ProtocolType.Udp);
0
5543
by: 14Dallas | last post by:
Hi, I have been working with another programmer to write this code. I haven't written code in years - DBase III and Pascal - anyways, back to my code question. The program opens a file and reads the contents that are seperated by spaces, not tabs - will never be seperated by tabs as it is output from another program. The contents of the file are essiantlly 3 fields/values # # Text Field 1 will be a number from 1 to 26, Field 2 will...
9
13575
by: xparrot1 | last post by:
I know that I can get the SERVER port number like this: HttpContext.Current.Request.ServerVariables My question is how do I get the remote CLIENT port number? Thanks Derek
2
7030
by: Paul Sijben | last post by:
To automate/ease configuration in my app I am trying to find out to which serial port a certain bluetooth device is connected. With pybluez I can find out which bluetooth devices I have, but it will not tell me the serial port they are mapped to. Is there a way to figure this out from python? (I am insterested in the platforms WinXP and linux primarily) Paul Sijben
0
9647
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10357
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10104
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9959
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8988
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7510
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5397
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4063
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3668
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.