473,756 Members | 1,818 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

When do I use System.Net.Sock ets.TcpClient and System.Net.Sock ets.Socket?

Hi,

What is the different between 'System.Net.Soc kets.Socket' and
'System.Net.Soc kets.TcpClient' ?
When do I use System.Net.Sock ets.TcpClient and System.Net.Sock ets.Socket??

Yours, Jonas
Nov 20 '05 #1
4 6320

"BadOmen" <ba*******@hotm ail.com> wrote in message
news:ik******** ************@ne wsc.telia.net.. .
Hi,

What is the different between 'System.Net.Soc kets.Socket' and
'System.Net.Soc kets.TcpClient' ?
When do I use System.Net.Sock ets.TcpClient and System.Net.Sock ets.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" <davidbaxterbro wne no potted me**@hotmail.co m> skrev i
meddelandet news:%2******** ********@tk2msf tngp13.phx.gbl. ..

"BadOmen" <ba*******@hotm ail.com> wrote in message
news:ik******** ************@ne wsc.telia.net.. .
Hi,

What is the different between 'System.Net.Soc kets.Socket' and
'System.Net.Soc kets.TcpClient' ?
When do I use System.Net.Sock ets.TcpClient and System.Net.Sock ets.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.Sock ets.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*******@hotm ail.com> wrote in message
news:Bu******** ************@ne wsc.telia.net.. .
Here comes a bunch of follow up questions :P

"David Browne" <davidbaxterbro wne no potted me**@hotmail.co m> skrev i
meddelandet news:%2******** ********@tk2msf tngp13.phx.gbl. ..

"BadOmen" <ba*******@hotm ail.com> wrote in message
news:ik******** ************@ne wsc.telia.net.. .
Hi,

What is the different between 'System.Net.Soc kets.Socket' and
'System.Net.Soc kets.TcpClient' ?
When do I use System.Net.Sock ets.TcpClient and System.Net.Sock ets.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.Sock ets.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.Sock ets.ProtocolFam ily
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" <davidbaxterbro wne no potted me**@hotmail.co m> skrev i
meddelandet news:Ok******** *****@TK2MSFTNG P11.phx.gbl...

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

"David Browne" <davidbaxterbro wne no potted me**@hotmail.co m> skrev i
meddelandet news:%2******** ********@tk2msf tngp13.phx.gbl. ..

"BadOmen" <ba*******@hotm ail.com> wrote in message
news:ik******** ************@ne wsc.telia.net.. .
> Hi,
>
> What is the different between 'System.Net.Soc kets.Socket' and
> 'System.Net.Soc kets.TcpClient' ?
> When do I use System.Net.Sock ets.TcpClient and System.Net.Sock ets.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.Sock ets.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.Sock ets.ProtocolFam ily
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
6859
by: Sagaert Johan | last post by:
i get this error if i write this : using System.Net.Sockets; .... .... TcpClient tcp; tcp=new TcpClient();
0
1650
by: Sagaert Johan | last post by:
this code using System; using System.Net.Sockets; namespace ConsoleApplication1 { /// <summary> /// Summary description for Class1. /// </summary>
6
4213
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
8200
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 TcpClient, NetworkStream and StreamWriter classes. but with low level socket it doesn't work (When using the Socket class Send method).
0
1972
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 server really sends everything I expect it to send. I am actually sending XML messages and this limit is a pain in the ... Here is the code: -------------------------------------------------------------------------- Dim tcpclient As New...
0
1298
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 right? Is there a possible way to say just have a client side TcpClient application to send a message to remote server like sending a text file? Do TcpClient requires a Internet connection to connect say to remote server? So, to connect to a VPN...
0
3168
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 System.Collections.Generic; using System.Net; using System.Net.Sockets; using System.Runtime.Serialization.Formatters.Binary;
8
2184
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. None of the overloads for either the Connect or BeginConnect methods takes that many inputs (basically they take host and port only). Would it be best to create a new class that derives from the base class System.Net.Sockets and implement a new...
1
4469
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 (re)connection (hitting the submit button) then I start to recieve a an error: IOException:System.IO.IOException: Der kunne ikke læses data fra transportforbindelsen (LPF: could not read data from the transport
0
9456
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9275
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10034
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9872
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9843
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8713
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6534
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
3805
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2666
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.