473,394 Members | 1,773 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

Port number versus a socket?

Hello

I'm about ready to attempt writting a simple TCP server in C# in which all I
need to do is send out some data to a particular IP and port, and the end
device will send it back to me. Almost like a ping, you could say. All I
need to do is a compare what I get back to what was sent, to make the end
unit is still alive.

So I've got an IP address of the end device and a port number. 192.168.1.2
5281 Can someone explain to me the difference between a port number and a
socket, and can anyone point to some example programs.

Thanks
Jul 14 '07 #1
2 2071

"Jason" <so*****@ms.netwrote in message
news:O3**************@TK2MSFTNGP04.phx.gbl...
Hello

I'm about ready to attempt writting a simple TCP server in C# in which all
I need to do is send out some data to a particular IP and port, and the
end device will send it back to me. Almost like a ping, you could say.
All I need to do is a compare what I get back to what was sent, to make
the end unit is still alive.

So I've got an IP address of the end device and a port number. 192.168.1.2
5281 Can someone explain to me the difference between a port number and a
socket, and can anyone point to some example programs.

Thanks
"To allow for many processes within a single host to use communication
facilities simultaneously, TCP provides a set of ports. A host machine
can support multiple ports, and each port has its own unique port number
within the host. A socket is formed from a concatenation of the port
number and a network address. The socket is a unique identifier
throughout all networks connected together. "

http://zaphod1.grc.nasa.gov/tcp-impl...hive/0828.html
Jul 14 '07 #2

In a nutshell, a socket is IP address + protocol + port number.

Jul 15 '07 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

21
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...
5
by: Keith | last post by:
I am trying to write a simple FTP client, but I am having trouble with the PORT Command. Does anyone know how to Get an IP Address and port number to establish a data port for the server to...
5
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...
2
by: Mitch Mooney | last post by:
Im trying to make a wrapper and need to return the local port that the new connection/socket is being made on. The following code the RaiseEvent, the tmpsoc.localPort is returned as 0. How do I get...
2
by: jasonsgeiger | last post by:
From: "Factor" <jasonsgeiger@gmail.com> Newsgroups: microsoft.public.in.csharp Subject: Multiple Clients, One port Date: Wed, 19 Apr 2006 09:36:02 -0700 I'm been working with sockets for a...
6
by: swartzbill2000 | last post by:
If I do this: Dim receiver As New UdpClient() Then the documentation says the system will pick a port. How can I extract the chosen port number from receiver? Bill
3
by: Jason | last post by:
Hello I've got some test code that I've found on the web that is a TCP server and a TCP client. The server sends data to the client on the port i specify. I know because get the port number...
5
by: naamala | last post by:
Hi, How can i get unused/available port in the local system using C# ? Or Is there any way to find out whether the particular port number is being used by any other application using C#? ...
3
by: Sebouh | last post by:
Hi guys. I have a question about sockets. It appears that the accept function returns a socket descriptor after creating a new socket handler. This new handler inherits the properties of the socket...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
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...

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.