Re: TCP out of band data and read()
- From: Barry Margolin <barmar@xxxxxxxxxxxx>
- Date: Thu, 12 Jul 2007 21:45:58 -0400
In article <f7526c$pcn$1@xxxxxxxxxxxxxxxxxxxxx>,
Rainer Temme <Rainer_Temme@xxxxxxxxxxxxxxxxxxxxxx> wrote:
If an application is using read() instead of recv() on a TCP socket ,
what happens if some out of band data is sent? Does read() just read
it in as normal data or is it stored away elsewhere and only be
recovered using one of the recv*() functions?
To my knowledge, TCP has no mechanism to transport
"out-of-band" data.
TCP has an "urgent-mode" that is, a part ot the
transmitted data can be marked as urgent. The
reaction on the arrival of such data is depending on
the receiving process. It can ...
True, but the sockets API automatically treats the byte that the urgent
pointer points to as OOB data.
... read all data before the urgent data and store it for later
processing ... read and process the urgent data ... process
the stored data ... continue with normal processing
Which is what the sockets API does.
... read and drop all data before the urgent data ...
process the urgent data ... continue with normal
processing
AFAIK, the sockets API doesn't provide any way for an application to do
this, because you don't get access to the urgent pointer itself.
... ignore the fact that some data is urgent completely
and just treat all data as normal.
But the process cannot read the urgent-data out of sequence.
The OP's question was: what happens to the byte that the urgent pointer
points to if you use the standard Unix stream API (i.e. read()) rather
than the sockets API (recv()).
--
Barry Margolin, barmar@xxxxxxxxxxxx
Arlington, MA
*** PLEASE post questions in newsgroups, not directly to me ***
*** PLEASE don't copy me on replies, I'll read them in the group ***
.
- Follow-Ups:
- Re: TCP out of band data and read()
- From: guenther@xxxxxxxxx
- Re: TCP out of band data and read()
- References:
- TCP out of band data and read()
- From: Boltar
- Re: TCP out of band data and read()
- From: Rainer Temme
- TCP out of band data and read()
- Prev by Date: Re: What errno value should I receive if trying to create a file an a read-only NFS volume
- Next by Date: Re: Most Complex Problem
- Previous by thread: Re: TCP out of band data and read()
- Next by thread: Re: TCP out of band data and read()
- Index(es):
Relevant Pages
|