473,320 Members | 1,947 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,320 software developers and data experts.

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 6274

"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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Sagaert Johan | last post by:
i get this error if i write this : using System.Net.Sockets; .... .... TcpClient tcp; tcp=new TcpClient();
0
by: Sagaert Johan | last post by:
this code using System; using System.Net.Sockets; namespace ConsoleApplication1 { /// <summary> /// Summary description for Class1. /// </summary>
6
by: Kristian | last post by:
Hi All. This test code: using System.Net.Sockets; using System.Net; using System; class mail{ public static void Main(){
4
by: yaron | last post by:
Hi, I have a problem when sending data over TCP socket from c# client to java server. the connection established ok, but i can't send data from c# client to java server. it's work ok with...
0
by: Torsten Brasch | last post by:
Hi All and Happy New Year ;) I have a very strange problem with System.Net.Sockets.TcpClient(). For some reason, the number of bytes I can receive is limited to 5460 bytes. I made sure that the...
0
by: den 2005 | last post by:
Hi everybody, I am still learning how sockets, TcpClient and TcpListener work, in order that both sides to send and receive data, both sides must have a socket or TcpListener and a TcpListener...
0
by: Buddy Home | last post by:
There is two examples of code. Example 1. Send and Receive within the same process. Put this code in a console app called SendAndReceive and run the code. using System; using...
8
by: JDavis | last post by:
I am using System.Net.Sockets to connect a client socket to a server that requires three inputs when I connect: host, port and an identification number that identifies the person connecting. ...
1
by: larspeter | last post by:
Hi all. I have a problem with TcpClient ... I am conneting to a server with TcpClient and returning the answer through a webservice. It actully all works fine. BUT if I make a lot of...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.