473,848 Members | 1,679 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Is HTTP an Async Protocol

Hi,

Simple question (although I guess with a complicated answer). Is HTTP
an async protocol? For instance, if I send a message to a c#
webservice via http what is the protocol actually doing?

Thanks in advance
Steffan

Jan 31 '06 #1
4 2487
> Simple question (although I guess with a complicated answer). Is HTTP
an async protocol?
Short answer, no.

Long answer: HTTP is a protocol. "asynch" is not relevant to protocols.
"asynch" (ansynchronous) is a term related to programming. It is a reference
to how a program performs certain types of operations. In a single-threaded
program, the program cannot execute more than one instruction at a time, as
a single thread cannot execute more than one instruction at a time.
Therefore, any instruction which takes a certain amount of time to execute
will "block" the execution of the thread until it is completed. In a
multio-threaded program, you have the option of performing operations
"asynchronously " (that is, independently of each other, wthout having to
wait).

A protocol is a standard for communication. Network protocols almost
entirely work in the same way that humans communicate. That is, a computer
sends a message to another computer, and the other computer responds to that
message. Since there are any number of reasons why a response might be
delayed, or even not occur, network applications generally use asynchronous
threads to communicate with other network resources. This way, the program
can create a thread to do the communication, and continue with other work.
When the communication thread receives a response, or times out waiting for
one, it can notify the application, via an event or callback, which can then
react to the response.

The HTTP protocol is a networking protocol. It defines a set of standards
for applications to communicate on a TCP network. This set of standards is
based upon a client-server Request/Response exchange. The client makes an
HTTP request of the HTTP server, which then responds with an HTTP response.
These requests and responses are at least partially in the form of text,
although binary data can accompany the message. The protocol itself,
however, is pure text.

For a quick and easy "crash course" on HTTP, see:

http://www.jmarshall.com/easy/http/

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
Who is Mighty Abbott?
A twin turret scalawag.

"Bob Badger" <sj********@hot mail.com> wrote in message
news:11******** **************@ g43g2000cwa.goo glegroups.com.. . Hi,

Simple question (although I guess with a complicated answer). Is HTTP
an async protocol? For instance, if I send a message to a c#
webservice via http what is the protocol actually doing?

Thanks in advance
Steffan

Jan 31 '06 #2
Kevin Spencer wrote:
Simple question (although I guess with a complicated answer). Is HTTP
an async protocol?


Short answer, no.

Long answer: HTTP is a protocol. "asynch" is not relevant to protocols.
"asynch" (ansynchronous) is a term related to programming. It is a reference
to how a program performs certain types of operations. In a single-threaded
program, the program cannot execute more than one instruction at a time, as
a single thread cannot execute more than one instruction at a time.
Therefore, any instruction which takes a certain amount of time to execute
will "block" the execution of the thread until it is completed. In a
multio-threaded program, you have the option of performing operations
"asynchronously " (that is, independently of each other, wthout having to
wait).

A protocol is a standard for communication. Network protocols almost
entirely work in the same way that humans communicate. That is, a computer
sends a message to another computer, and the other computer responds to that
message. Since there are any number of reasons why a response might be
delayed, or even not occur, network applications generally use asynchronous
threads to communicate with other network resources. This way, the program
can create a thread to do the communication, and continue with other work.
When the communication thread receives a response, or times out waiting for
one, it can notify the application, via an event or callback, which can then
react to the response.

The HTTP protocol is a networking protocol. It defines a set of standards
for applications to communicate on a TCP network. This set of standards is
based upon a client-server Request/Response exchange. The client makes an
HTTP request of the HTTP server, which then responds with an HTTP response.
These requests and responses are at least partially in the form of text,
although binary data can accompany the message. The protocol itself,
however, is pure text.

For a quick and easy "crash course" on HTTP, see:

http://www.jmarshall.com/easy/http/


While still synchronous, HTTP/1.1 does support pipelining. Normally
each HTTP request is made one after the other. You can see this by
connecting (use telnet.exe to port 80) to a web server and issuing GET
commands. Using pipelining you can issue lots of commands all at once,
and get lots of response all at once. The commands can even finish out
of order and ultimately our http client libraries can act on those
commands out of order, this type of facilities helps enable our use of
asynchronous programming approaches.

See http://www.w3.org/Protocols/HTTP/Per.../Pipeline.html

Now the unknown question is: Do the various .NET Http libraries support
using pipelining? Could threads share a Http connection pool which
pipelines commands on open Http connections? Does it matter? How much
may this accelerate my use of Web Services.

Often I wish I had a job in research which would allow me to investigate
and answer these questions.
--
Jay R. Wren
Jan 31 '06 #3
you are not quite correct. TCP/IP is an asynchronous protocol (like most
network protocols). .net api webclient give a sync and async interface to
the protocol, which may confuse you.

the difference between a synchronous and asynchronous protocol is in timing.
a synchronous protocol (like an atm switch uses), has standard time slices,
and packets are guaranteed to be delivered in that timeslice.

HTTP is actually 3 layers

network layer (IP)
transport layer (TCP/IP)
session layer (HTTP)

IP is a an asynchronous datagram layer
TCP/IP is an asynchronous reliable delivery layer, the sender get
acknowledgement that each packet was received, and the receiver get packets
delivered in transmit order.

HTTP is a session layer. it is a simple send request, receive a response
protocol. when the client sends the request, it has no idea of how long the
response will take.

when a library supplies an api to a network protocol, it can supply a
blocking or nonblocking api. this is commonly referred to as synchronous /
asynchronous (but this is not strickly true, most operating systems run all
code asynchronously, as any real-time programmer will tell you). when in
blocking mode it looks synchronous, because the next statement will not run
until the network request completes, while in nonblocking mode you do not
which code statement will be executing when the request completes.

with a nonblocking api there are two approaches, one where your code polls
for a completion status (unix i/o approach), and a asynchronous trap mode,
where a completion routine (delegate in .net terms) is called when the
request completes.

this is all different then using a seperate thread for calling a blocking
api.
-- bruce (sqlwork.com)



"Kevin Spencer" <ke***@DIESPAMM ERSDIEtakempis. com> wrote in message
news:%2******** ********@TK2MSF TNGP11.phx.gbl. ..
Simple question (although I guess with a complicated answer). Is HTTP
an async protocol?


Short answer, no.

Long answer: HTTP is a protocol. "asynch" is not relevant to protocols.
"asynch" (ansynchronous) is a term related to programming. It is a
reference to how a program performs certain types of operations. In a
single-threaded program, the program cannot execute more than one
instruction at a time, as a single thread cannot execute more than one
instruction at a time. Therefore, any instruction which takes a certain
amount of time to execute will "block" the execution of the thread until
it is completed. In a multio-threaded program, you have the option of
performing operations "asynchronously " (that is, independently of each
other, wthout having to wait).

A protocol is a standard for communication. Network protocols almost
entirely work in the same way that humans communicate. That is, a computer
sends a message to another computer, and the other computer responds to
that message. Since there are any number of reasons why a response might
be delayed, or even not occur, network applications generally use
asynchronous threads to communicate with other network resources. This
way, the program can create a thread to do the communication, and continue
with other work. When the communication thread receives a response, or
times out waiting for one, it can notify the application, via an event or
callback, which can then react to the response.

The HTTP protocol is a networking protocol. It defines a set of standards
for applications to communicate on a TCP network. This set of standards is
based upon a client-server Request/Response exchange. The client makes an
HTTP request of the HTTP server, which then responds with an HTTP
response. These requests and responses are at least partially in the form
of text, although binary data can accompany the message. The protocol
itself, however, is pure text.

For a quick and easy "crash course" on HTTP, see:

http://www.jmarshall.com/easy/http/

--
HTH,

Kevin Spencer
Microsoft MVP
.Net Developer
Who is Mighty Abbott?
A twin turret scalawag.

"Bob Badger" <sj********@hot mail.com> wrote in message
news:11******** **************@ g43g2000cwa.goo glegroups.com.. .
Hi,

Simple question (although I guess with a complicated answer). Is HTTP
an async protocol? For instance, if I send a message to a c#
webservice via http what is the protocol actually doing?

Thanks in advance
Steffan


Feb 1 '06 #4
Thanks for the clarification Bruce. I suppose it's a matter of how one
interprets the question, and/or the definition of "HTTP" in the context of
the question. If you say that HTTP is 3 layers, which is true in one sense,
you are including the network and transport layer, which are not
HTTP-specific. TCP/IP and IP are used by many protocols. As the poster was
asking specifically about HTTP, I made an assumption which may or may not
have been correct about what he was asking. However, after your
clarification, I'm sure he has all the information he needs.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
Who is Mighty Abbott?
A twin turret scalawag.

"Bruce Barker" <br************ ******@safeco.c om> wrote in message
news:O8******** ******@TK2MSFTN GP15.phx.gbl...
you are not quite correct. TCP/IP is an asynchronous protocol (like most
network protocols). .net api webclient give a sync and async interface to
the protocol, which may confuse you.

the difference between a synchronous and asynchronous protocol is in
timing. a synchronous protocol (like an atm switch uses), has standard
time slices, and packets are guaranteed to be delivered in that timeslice.

HTTP is actually 3 layers

network layer (IP)
transport layer (TCP/IP)
session layer (HTTP)

IP is a an asynchronous datagram layer
TCP/IP is an asynchronous reliable delivery layer, the sender get
acknowledgement that each packet was received, and the receiver get
packets delivered in transmit order.

HTTP is a session layer. it is a simple send request, receive a response
protocol. when the client sends the request, it has no idea of how long
the response will take.

when a library supplies an api to a network protocol, it can supply a
blocking or nonblocking api. this is commonly referred to as synchronous /
asynchronous (but this is not strickly true, most operating systems run
all code asynchronously, as any real-time programmer will tell you). when
in blocking mode it looks synchronous, because the next statement will not
run until the network request completes, while in nonblocking mode you do
not which code statement will be executing when the request completes.

with a nonblocking api there are two approaches, one where your code polls
for a completion status (unix i/o approach), and a asynchronous trap
mode, where a completion routine (delegate in .net terms) is called when
the request completes.

this is all different then using a seperate thread for calling a blocking
api.
-- bruce (sqlwork.com)



"Kevin Spencer" <ke***@DIESPAMM ERSDIEtakempis. com> wrote in message
news:%2******** ********@TK2MSF TNGP11.phx.gbl. ..
Simple question (although I guess with a complicated answer). Is HTTP
an async protocol?


Short answer, no.

Long answer: HTTP is a protocol. "asynch" is not relevant to protocols.
"asynch" (ansynchronous) is a term related to programming. It is a
reference to how a program performs certain types of operations. In a
single-threaded program, the program cannot execute more than one
instruction at a time, as a single thread cannot execute more than one
instruction at a time. Therefore, any instruction which takes a certain
amount of time to execute will "block" the execution of the thread until
it is completed. In a multio-threaded program, you have the option of
performing operations "asynchronously " (that is, independently of each
other, wthout having to wait).

A protocol is a standard for communication. Network protocols almost
entirely work in the same way that humans communicate. That is, a
computer sends a message to another computer, and the other computer
responds to that message. Since there are any number of reasons why a
response might be delayed, or even not occur, network applications
generally use asynchronous threads to communicate with other network
resources. This way, the program can create a thread to do the
communication, and continue with other work. When the communication
thread receives a response, or times out waiting for one, it can notify
the application, via an event or callback, which can then react to the
response.

The HTTP protocol is a networking protocol. It defines a set of standards
for applications to communicate on a TCP network. This set of standards
is based upon a client-server Request/Response exchange. The client makes
an HTTP request of the HTTP server, which then responds with an HTTP
response. These requests and responses are at least partially in the form
of text, although binary data can accompany the message. The protocol
itself, however, is pure text.

For a quick and easy "crash course" on HTTP, see:

http://www.jmarshall.com/easy/http/

--
HTH,

Kevin Spencer
Microsoft MVP
.Net Developer
Who is Mighty Abbott?
A twin turret scalawag.

"Bob Badger" <sj********@hot mail.com> wrote in message
news:11******** **************@ g43g2000cwa.goo glegroups.com.. .
Hi,

Simple question (although I guess with a complicated answer). Is HTTP
an async protocol? For instance, if I send a message to a c#
webservice via http what is the protocol actually doing?

Thanks in advance
Steffan



Feb 1 '06 #5

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

Similar topics

8
10659
by: turnit \(removethis\) | last post by:
I have a login form that uses the post method to carry the information to the next page. The form works just fine in ie6.0, but fails in mozilla and fails in ie5.2 on a mac. "HTTP/1.1 400 Bad Request" was the original error msg now that I reinstalled iislockdown and urscan I get "The parameter is incorrect." If I use the get method with this form it works just fine on everything. I can't say for certain but I think this problem started...
0
994
by: David | last post by:
I am building a library that comunicate with a custom service through a custom protocol using Sockets. I want to implement a BeginExecute, so the command is sent to the server and I release the workerThread. When the reply comes I call the callback function passed to the BeginExecute. I want to do something like the BeginSend and EndSend of the Socket, but I need to implement by my self. Is necessary to use a Collection in order to...
2
497
by: brendonlam | last post by:
Hi there, Hoping someone could advise me here pls; I'm creating a C# class that implements a telnet client socket allowing a VB . NET application to communicate with telnet servers. After leaving the app running for just 6 hrs, the thread count exploded to close to 1000, before the app finally stops responding. The handles probably hit close to 10000. Tracing my code, I isolated the leak to when I execute a telnet command. Everytime I...
3
3920
by: Stig-Arne Basberg | last post by:
I am working on a project where I want to send at file from a Win CE device to a receiving PC using the HTTP protocol. For testing purpose I made a simple test app on my PC (code below). The problem is that only the first 8760 bytes of the file is transfered. I have tried several times and the received file is always 8760 bytes. I have tested with several files (10k -> 200k). My receiving application works very well with other...
0
1036
by: Dan Diephouse | last post by:
I am working on developing a series of web services around the jabber protocol. I have written the necessary soap over jabber code on the server side (java) and am now working on the client side in C#. I am trying to determine a mode of development because the standard "create a server side wsdl and generate client stubs" doesn't seem to work well. I am new to async web services, so bear with me if I am doing this wrong. What I...
3
2416
by: Sundar | last post by:
how d you classify a serial com port application as a asynchronous or a synchronous operation...Meaning if i hve a handshakeing protocol t b implemented then is it async or sync?
1
2483
by: Rogier | last post by:
Hello, I'm Writing my own NZb download App, using Async Network Streams en Callback delegates. The Problem is that if I Want tot Receive Large chunks of data (for instance the LIST NEWSGROUPS Response). I do not get the Data at once. Here is a piece of my source code: I call the NetworkStream.ReadBegin as follows:
10
4520
by: Frankie | last post by:
It appears that System.Random would provide an acceptable means through which to generate a unique value used to identify multiple/concurrent asynchronous tasks. The usage of the value under consideration here is that it is supplied to the AsyncOperationManager.CreateOperation(userSuppliedState) method... with userSuppliedState being, more or less, a taskId. In this case, the userSuppliedState {really taskId} is of the object type,...
2
4345
by: dougmcmurtry | last post by:
I have an Asynchronous socket that sends data to a server for credit card approvals. The socket is kept alive by the server through a heartbeat that sends a "beat" every 90 seconds. Trouble is that the network is unreliable at times and thus the server will drop my connection from time to time. I need to code around this so I can reconnect to the server whenever this happens. THE PROBLEM: The Connected, Poll, and Available properties...
0
9893
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
9738
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
11001
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
10664
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...
0
10348
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...
0
9500
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
7069
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();...
0
5919
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
4137
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.