aspdotnet
March 17th, 2003, 09:27 AM
there are two way to develop network programming..
brand new TcpClient,TcpListener and old Socket ...
what is the difference between TcpClient,TcpListene and Socket ?
if you were develop any network program, which one would you use?
MartinL
March 17th, 2003, 11:30 AM
There is nothing as "new" or "old" class for networking in .net framework...
.Net framework's Socket class is managed version of Internet Transport Service. It is used to provide internet connection on the "low-level".
TcpClient class is build upon Socket class. TcpClient provides TCP connection at a higher level of abstraction. You are not dealing with low-level networking stuff as you do if you use Socket class.
However, there are not just a TcpClient and TcpListener classes. There are also UdpClient, WebRequest and much more using sockets for providing internet connection...
So generally, Socket is low-level class providing internet connection while TcpClient, UdpClient are more specialized classes based on or internally using Socket class. You can use TcpClient or UdpClient classes if you don't need to handle the comunication on the low-level and you know which protocol you will use for communication (TCP or UDP).
If you want to use another protocol, as IPX, SPX, ICMP, IDP, Raw UP Packets, or you want to have complete control over the internet connection, you need to use Socket class...
Martin
aspdotnet
March 17th, 2003, 11:46 AM
thank you...so much , MartinL :D :D