473,238 Members | 1,801 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,238 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 6271

"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: jianzs | last post by:
Introduction Cloud-native applications are conventionally identified as those designed and nurtured on cloud infrastructure. Such applications, rooted in cloud technologies, skillfully benefit from...
0
by: abbasky | last post by:
### Vandf component communication method one: data sharing ​ Vandf components can achieve data exchange through data sharing, state sharing, events, and other methods. Vandf's data exchange method...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
Git
by: egorbl4 | last post by:
Скачал я git, хотел начать настройку, а там вылезло вот это Что это? Что мне с этим делать? ...
1
by: davi5007 | last post by:
Hi, Basically, I am trying to automate a field named TraceabilityNo into a web page from an access form. I've got the serial held in the variable strSearchString. How can I get this into the...
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: Aftab Ahmad | last post by:
Hello Experts! I have written a code in MS Access for a cmd called "WhatsApp Message" to open WhatsApp using that very code but the problem is that it gives a popup message everytime I clicked on...
0
by: Aftab Ahmad | last post by:
So, I have written a code for a cmd called "Send WhatsApp Message" to open and send WhatsApp messaage. The code is given below. Dim IE As Object Set IE =...

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.