By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
457,864 Members | 1,293 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 457,864 IT Pros & Developers. It's quick & easy.

Port number versus a socket?

P: n/a
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
Share this Question
Share on Google+
2 Replies


P: n/a

"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

P: n/a

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

Jul 15 '07 #3

This discussion thread is closed

Replies have been disabled for this discussion.