469,133 Members | 1,307 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,133 developers. It's quick & easy.

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

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
Nov 20 '05 #1
4 6048

"BadOmen" <ba*******@hotmail.com> wrote in message
news:ik********************@newsc.telia.net...
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??


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
Nov 20 '05 #2
Here comes a bunch of follow up questions :P

"David Browne" <davidbaxterbrowne no potted me**@hotmail.com> skrev i
meddelandet news:%2****************@tk2msftngp13.phx.gbl...

"BadOmen" <ba*******@hotmail.com> wrote in message
news:ik********************@newsc.telia.net...
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??
TcpClient is a helper class on top of Socket. It greatly simplifies

writing to tcp/ip sockets.
ok :-)
Sockets is a lower level and is capable of doing things other thatn tcp/ip, like udp, raw sockets and even non-ip networking.
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?


David

Nov 20 '05 #3

"BadOmen" <ba*******@hotmail.com> wrote in message
news:Bu********************@newsc.telia.net...
Here comes a bunch of follow up questions :P

"David Browne" <davidbaxterbrowne no potted me**@hotmail.com> skrev i
meddelandet news:%2****************@tk2msftngp13.phx.gbl...

"BadOmen" <ba*******@hotmail.com> wrote in message
news:ik********************@newsc.telia.net...
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??
TcpClient is a helper class on top of Socket. It greatly simplifies

writing
to tcp/ip sockets.


ok :-)
Sockets is a lower level and is capable of doing things other thatn

tcp/ip,
like udp, raw sockets and even non-ip networking.


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?
correct, assuming you avoid the annoying little pitfalls of socket
programming that TcpClient protects you from.

what does it use instead of a IP? DNS
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.
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?


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
Nov 20 '05 #4
Thanx!
you have been of great help to me :-)

Yours, Jonas

"David Browne" <davidbaxterbrowne no potted me**@hotmail.com> skrev i
meddelandet news:Ok*************@TK2MSFTNGP11.phx.gbl...

"BadOmen" <ba*******@hotmail.com> wrote in message
news:Bu********************@newsc.telia.net...
Here comes a bunch of follow up questions :P

"David Browne" <davidbaxterbrowne no potted me**@hotmail.com> skrev i
meddelandet news:%2****************@tk2msftngp13.phx.gbl...

"BadOmen" <ba*******@hotmail.com> wrote in message
news:ik********************@newsc.telia.net...
> 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??
>

TcpClient is a helper class on top of Socket. It greatly simplifies

writing
to tcp/ip sockets.


ok :-)
Sockets is a lower level and is capable of doing things other thatn

tcp/ip,
like udp, raw sockets and even non-ip networking.


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?


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

what does it use instead of a IP? DNS


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.
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?


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

Nov 20 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

6 posts views Thread by Kristian | last post: by
reply views Thread by Torsten Brasch | last post: by
reply views Thread by den 2005 | last post: by
8 posts views Thread by JDavis | last post: by
1 post views Thread by larspeter | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by zhoujie | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.