When do I use System.Net.Sockets.TcpClient and System.Net.Sockets.Socket?

When do I use System.Net.Sockets.TcpClient and System.Net.Sockets.Socket?

Post by BadOme » Sat, 06 Mar 2004 23:41:18


Hi,

What is the different between 'System.Net.Sockets.Socket' and
'System.Net.Sockets.TcpClient'?
When do I use System.Net.Sockets.TcpClient and System.Net.Sockets.Socket??

Yours, Jonas
 
 
 

When do I use System.Net.Sockets.TcpClient and System.Net.Sockets.Socket?

Post by David Brow » Sun, 07 Mar 2004 00:17:38


TcpClient is a helper class on top of Socket. It greatly simplifies writing
to tcp/ip sockets.
Sockets is a lower level and is capable of doing things other thatn tcp/ip,
like udp, raw sockets and even non-ip networking.

David

 
 
 

When do I use System.Net.Sockets.TcpClient and System.Net.Sockets.Socket?

Post by BadOme » Sun, 07 Mar 2004 01:00:33

Here comes a bunch of follow up questions :P

"David Browne" <davidbaxterbrowne no potted XXXX@XXXXX.COM > skrev i



System.Net.Sockets.Socket??
writing

ok :-)

tcp/ip,

I have seen in VB6 raw socket option but I don't know what it is... What is
it? :-)

The TCP/IP connection will work at the same way as if I use
System.Net.Sockets.Socket it is just that I cant use raw sockets, udp and
non-ip networking?

what does it use instead of a IP? DNS

I want to make a little app. that can be able to read a html page from an
other computer using my app. (connect to my app. on an other computer and
see a html presentation) I also want to be able to send a text message to
that app. and save it in a XML page so I can look at it from any computer
with my app.
It will also be possible to send text messages between my app's. that will
not be saved just display at arrival.
Is this possible using the TcpClient?
 
 
 

When do I use System.Net.Sockets.TcpClient and System.Net.Sockets.Socket?

Post by David Brow » Sun, 07 Mar 2004 01:58:00


is

correct, assuming you avoid the annoying little pitfalls of socket
programming that TcpClient protects you from.



DNS runs on IP.
One hardly remembers anymore that there are networking protocols other than
IP, but look at:
System.Net.Sockets.ProtocolFamily
There're not all implemented, but it will give you an idea of of the level
of generality that the Socket represents.


TcpClient is all you need. Perhaps TcpListener as well.
HTTP runs on top of TCP/IP, so you can use TCP/IP for everyting.

David
 
 
 

When do I use System.Net.Sockets.TcpClient and System.Net.Sockets.Socket?

Post by BadOme » Sun, 07 Mar 2004 03:52:57

Thanx!
you have been of great help to me :-)

Yours, Jonas

"David Browne" <davidbaxterbrowne no potted XXXX@XXXXX.COM > skrev i






and
than
an
and
to
computer
will