473,657 Members | 2,595 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

tcpclient socket webrequest

tcpclient socket webrequest
what are each used for? I read some reference books and did some research on
the internet, but I'm still confused.
could someone clarify this for me?
Thanks,
Aaron
Jul 21 '05 #1
3 2626
Hi Aaron,

Basically, you're lloking at similar types of classes for different levels
of network communication.

A Socket is a class for any type of network connection. It is a low-level,
generic class for sending and receiving data over a network, and can work
with virtually any type of protocol.

A TCPClient is a higher-level class for working with the TCP protocol. It
has a Socket (protected Client property) that does the actual connection,
and has properties and methods for communicating via the TCP protocol.

A WebRequest is a higher-level class for sending an HTTP Request over a TCP
connection. It contains properties and methods for sending an HTTP Request,
as well as properties and methods for receiving the HTTP Response that comes
back.

These are an excellent example of how Microsoft provides programming tools
of virtually any level necessary to perform development tasks. For example,
you could write your own TCP Client class by creating a class that uses a
Socket to connect to a TCP port. You could further extend that class by
creating a class that sends an HTTP Request and listens for an HTTP
Response. But Microsoft has already created such classes for you. On the
other hand, if you needed to create an FTP client, which Microsoft has NOT
provided, you could start with a Socket and go from there, building your own
properties and methods to send and receive FTP proptocol messages over a TCP
port.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
What You Seek Is What You Get.

"Aaron" <ku*****@yahoo. com> wrote in message
news:O5******** ********@tk2msf tngp13.phx.gbl. ..
tcpclient socket webrequest
what are each used for? I read some reference books and did some research
on the internet, but I'm still confused.
could someone clarify this for me?
Thanks,
Aaron

Jul 21 '05 #2
thank you.

i always thought the ftp protocal was built on tcp. so i need to use sockets
instead of tcpclient?

is there anything lower than sockets?
what is the lowest level .Net can access? what about C/native unmanged?

Aaron

"Kevin Spencer" <ke***@DIESPAMM ERSDIEtakempis. com> wrote in message
news:eb******** *****@TK2MSFTNG P12.phx.gbl...
Hi Aaron,

Basically, you're lloking at similar types of classes for different levels
of network communication.

A Socket is a class for any type of network connection. It is a low-level,
generic class for sending and receiving data over a network, and can work
with virtually any type of protocol.

A TCPClient is a higher-level class for working with the TCP protocol. It
has a Socket (protected Client property) that does the actual connection,
and has properties and methods for communicating via the TCP protocol.

A WebRequest is a higher-level class for sending an HTTP Request over a
TCP connection. It contains properties and methods for sending an HTTP
Request, as well as properties and methods for receiving the HTTP Response
that comes back.

These are an excellent example of how Microsoft provides programming tools
of virtually any level necessary to perform development tasks. For
example, you could write your own TCP Client class by creating a class
that uses a Socket to connect to a TCP port. You could further extend that
class by creating a class that sends an HTTP Request and listens for an
HTTP Response. But Microsoft has already created such classes for you. On
the other hand, if you needed to create an FTP client, which Microsoft has
NOT provided, you could start with a Socket and go from there, building
your own properties and methods to send and receive FTP proptocol messages
over a TCP port.

--
HTH,

Kevin Spencer
Microsoft MVP
.Net Developer
What You Seek Is What You Get.

"Aaron" <ku*****@yahoo. com> wrote in message
news:O5******** ********@tk2msf tngp13.phx.gbl. ..
tcpclient socket webrequest
what are each used for? I read some reference books and did some research
on the internet, but I'm still confused.
could someone clarify this for me?
Thanks,
Aaron


Jul 21 '05 #3
> is there anything lower than sockets?
what is the lowest level .Net can access? what about C/native unmanged?
Yes, there is PLENTY lower than Sockets. As for the lowest level that .Net
can access, I would have to guess Assembler (not MSIL - Assembler), as C
allows inline Assembler, C++ is a superset of C, and C# allows inline C++
(unsafe/unmanaged). On the other hand, I wouldn't know for sure, as I
haven't had occasion to use Assembler for many years!

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
What You Seek Is What You Get.

"Aaron" <ku*****@yahoo. com> wrote in message
news:ut******** ******@TK2MSFTN GP09.phx.gbl... thank you.

i always thought the ftp protocal was built on tcp. so i need to use
sockets instead of tcpclient?

is there anything lower than sockets?
what is the lowest level .Net can access? what about C/native unmanged?

Aaron

"Kevin Spencer" <ke***@DIESPAMM ERSDIEtakempis. com> wrote in message
news:eb******** *****@TK2MSFTNG P12.phx.gbl...
Hi Aaron,

Basically, you're lloking at similar types of classes for different
levels of network communication.

A Socket is a class for any type of network connection. It is a
low-level, generic class for sending and receiving data over a network,
and can work with virtually any type of protocol.

A TCPClient is a higher-level class for working with the TCP protocol. It
has a Socket (protected Client property) that does the actual connection,
and has properties and methods for communicating via the TCP protocol.

A WebRequest is a higher-level class for sending an HTTP Request over a
TCP connection. It contains properties and methods for sending an HTTP
Request, as well as properties and methods for receiving the HTTP
Response that comes back.

These are an excellent example of how Microsoft provides programming
tools of virtually any level necessary to perform development tasks. For
example, you could write your own TCP Client class by creating a class
that uses a Socket to connect to a TCP port. You could further extend
that class by creating a class that sends an HTTP Request and listens for
an HTTP Response. But Microsoft has already created such classes for you.
On the other hand, if you needed to create an FTP client, which Microsoft
has NOT provided, you could start with a Socket and go from there,
building your own properties and methods to send and receive FTP
proptocol messages over a TCP port.

--
HTH,

Kevin Spencer
Microsoft MVP
.Net Developer
What You Seek Is What You Get.

"Aaron" <ku*****@yahoo. com> wrote in message
news:O5******** ********@tk2msf tngp13.phx.gbl. ..
tcpclient socket webrequest
what are each used for? I read some reference books and did some
research on the internet, but I'm still confused.
could someone clarify this for me?
Thanks,
Aaron



Jul 21 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
9089
by: Daniel | last post by:
TcpClient close() method socket leak when i use TcpClient to open a connection, send data and close the TcpClient with myTcpClientInstance.Close(); it takes 60 seconds for the actual socket on the client machine to close per my network app the computer fills up w/ thousands of these :0 TCP foobox:8888 localhost:2188 TIME_WAIT :0 TCP foobox:8888 localhost:2189 TIME_WAIT :0 TCP foobox:8888 localhost:2190 TIME_WAIT
5
72243
by: Horst Walter | last post by:
What is wrong here? IPAddress ipAddress = IPAddress.Parse("10.10.20.1"); IPEndPoint ipEndPoint = new IPEndPoint(ipAddress, this.port); this.tcpClient = new TcpClient(ipEndPoint); // PROBLEM HERE => Exception: "The requested address is not valid in its context" This works:
10
25115
by: Abubakar | last post by:
hi, I work on a computer that is part of a network and uses proxy to connect to net. I cant connect to servers outside my proxy with simple ConnectTo code. I need to know how to make my requests go through proxy. eg, _socket = new TcpClient("http://msdn.microsoft.com", port); does not work. Thanx. Ab.
3
28641
by: Ricardo Quintanilla | last post by:
i had a problem whom i do not know how to explain. i was using a TcpClient (System.Net.Sockets.TcpClient) object to send and receive data to an AS400 socket. Two months ago it started to work slowly, about 4 seconds between send and receive. In our production environment with hundreds of transactions it was truly costly. a while ago i changed de TcpClient object. Now i am using a Socket (System.Net.Sockets.Socket) object and it...
3
1816
by: Aaron | last post by:
tcpclient socket webrequest what are each used for? I read some reference books and did some research on the internet, but I'm still confused. could someone clarify this for me? Thanks, Aaron
4
6313
by: BadOmen | last post by:
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
1
4530
by: hamil | last post by:
I am having trouble using the TcpListener and TcpClient classes. At the end of this post is server code that runs, and a class whose purpose is described below. I need to know when the client closes the connection so I can exit my listener code. Here is what I have tried. First I asked MSDN and they said..
2
2851
by: Martin Arvidsson | last post by:
Hi! I am just beginning to learn about the TcpListener and TcpClient and Socket. I have figured out the TcpListener, it is used for booth in and outgoing requests, right? But when to use the TcpClient and when to use the Socket? Regards
4
20456
by: =?Utf-8?B?R2Vvcmdl?= | last post by:
Hello everyone, I am wondering if I am using TCPClient class in C#, how to setup timeout value? Timeout I mean, when connects to server for the 1st time, and during <timeoutinterval, if no server response is received, the GetStream method will return will return other than wait forever. thanks in advance,
0
8397
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
8310
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
8732
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
8503
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
8605
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6167
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5632
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();...
2
1957
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1620
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.