* Re: How much is available for reading on the socket?
2007-10-22 2:00 How much is available for reading on the socket? Łeandro Sales
@ 2007-11-09 13:39 ` Tommi Saviranta
2007-11-09 13:51 ` Gerrit Renker
` (6 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: Tommi Saviranta @ 2007-11-09 13:39 UTC (permalink / raw)
To: dccp
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset="windows-1252", Size: 385 bytes --]
On Sun, Oct 21, 2007 at 23:00:38 -0300, Łeandro Sales wrote:
> using "ioctl (socket, FIONREAD, &readsize)" I can get how much is
> available to read from the socket using TCP. Is there a equivalent
> option for DCCP?
Looks like dccp_ioctl() happily returns -ENOIOCTLCMD (for now). If you
have IO and memory to waste, you can always recv(..., MSG_PEEK) to work
around this.
^ permalink raw reply [flat|nested] 9+ messages in thread* Re: How much is available for reading on the socket?
2007-10-22 2:00 How much is available for reading on the socket? Łeandro Sales
2007-11-09 13:39 ` Tommi Saviranta
@ 2007-11-09 13:51 ` Gerrit Renker
2007-11-09 14:15 ` Tommi Saviranta
` (5 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: Gerrit Renker @ 2007-11-09 13:51 UTC (permalink / raw)
To: dccp
| > using "ioctl (socket, FIONREAD, &readsize)" I can get how much is
| > available to read from the socket using TCP. Is there a equivalent
| > option for DCCP?
|
| Looks like dccp_ioctl() happily returns -ENOIOCTLCMD (for now). If you
| have IO and memory to waste, you can always recv(..., MSG_PEEK) to work
| around this.
|
Arnaldo wrote a patch which realises SIOCINQ (it is in 2.6.24-rc1/2).
^ permalink raw reply [flat|nested] 9+ messages in thread* Re: How much is available for reading on the socket?
2007-10-22 2:00 How much is available for reading on the socket? Łeandro Sales
2007-11-09 13:39 ` Tommi Saviranta
2007-11-09 13:51 ` Gerrit Renker
@ 2007-11-09 14:15 ` Tommi Saviranta
2007-11-09 14:30 ` Arnaldo Carvalho de Melo
` (4 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: Tommi Saviranta @ 2007-11-09 14:15 UTC (permalink / raw)
To: dccp
On Fri, Nov 09, 2007 at 13:51:27 +0000, Gerrit Renker wrote:
> Arnaldo wrote a patch which realises SIOCINQ (it is in 2.6.24-rc1/2).
No, not one of these days again... Yes, I took a brief look at the patch
and its brief follow up. I was going through my inbox, including all the
mails I have postponed to deal with later, and spotted this one,
completely forgetting it's no longer relevant.
Sorry for the spam (like this email would make things any better).
^ permalink raw reply [flat|nested] 9+ messages in thread* Re: How much is available for reading on the socket?
2007-10-22 2:00 How much is available for reading on the socket? Łeandro Sales
` (2 preceding siblings ...)
2007-11-09 14:15 ` Tommi Saviranta
@ 2007-11-09 14:30 ` Arnaldo Carvalho de Melo
2007-11-13 16:51 ` Łeandro Sales
` (3 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: Arnaldo Carvalho de Melo @ 2007-11-09 14:30 UTC (permalink / raw)
To: dccp
Em Fri, Nov 09, 2007 at 01:51:27PM +0000, Gerrit Renker escreveu:
> | > using "ioctl (socket, FIONREAD, &readsize)" I can get how much is
> | > available to read from the socket using TCP. Is there a equivalent
> | > option for DCCP?
> |
> | Looks like dccp_ioctl() happily returns -ENOIOCTLCMD (for now). If you
> | have IO and memory to waste, you can always recv(..., MSG_PEEK) to work
> | around this.
> |
> Arnaldo wrote a patch which realises SIOCINQ (it is in 2.6.24-rc1/2).
And, on Linux:
include/linux/sockios.h
/* Linux-specific socket ioctls */
#define SIOCINQ FIONREAD
- Arnaldo
^ permalink raw reply [flat|nested] 9+ messages in thread* Re: How much is available for reading on the socket?
2007-10-22 2:00 How much is available for reading on the socket? Łeandro Sales
` (3 preceding siblings ...)
2007-11-09 14:30 ` Arnaldo Carvalho de Melo
@ 2007-11-13 16:51 ` Łeandro Sales
2007-11-15 7:02 ` Gerrit Renker
` (2 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: Łeandro Sales @ 2007-11-13 16:51 UTC (permalink / raw)
To: dccp
2007/11/9, Arnaldo Carvalho de Melo <acme@redhat.com>:
> Em Fri, Nov 09, 2007 at 01:51:27PM +0000, Gerrit Renker escreveu:
> > | > using "ioctl (socket, FIONREAD, &readsize)" I can get how much is
> > | > available to read from the socket using TCP. Is there a equivalent
> > | > option for DCCP?
> > |
> > | Looks like dccp_ioctl() happily returns -ENOIOCTLCMD (for now). If you
> > | have IO and memory to waste, you can always recv(..., MSG_PEEK) to work
> > | around this.
> > |
> > Arnaldo wrote a patch which realises SIOCINQ (it is in 2.6.24-rc1/2).
>
> And, on Linux:
>
> include/linux/sockios.h
>
> /* Linux-specific socket ioctls */
> #define SIOCINQ FIONREAD
>
> - Arnaldo
>
And I'm using this on the gstreamer plugin and it is working ok.
Leandro.
^ permalink raw reply [flat|nested] 9+ messages in thread* Re: How much is available for reading on the socket?
2007-10-22 2:00 How much is available for reading on the socket? Łeandro Sales
` (4 preceding siblings ...)
2007-11-13 16:51 ` Łeandro Sales
@ 2007-11-15 7:02 ` Gerrit Renker
2007-11-15 7:04 ` Gerrit Renker
2007-11-15 7:52 ` Ian McDonald
7 siblings, 0 replies; 9+ messages in thread
From: Gerrit Renker @ 2007-11-15 7:02 UTC (permalink / raw)
To: dccp
| > > Arnaldo wrote a patch which realises SIOCINQ (it is in 2.6.24-rc1/2).
| >
| > And, on Linux:
| >
| > include/linux/sockios.h
| >
| > /* Linux-specific socket ioctls */
| > #define SIOCINQ FIONREAD
| >
| > - Arnaldo
| >
|
| And I'm using this on the gstreamer plugin and it is working ok.
|
So that other people not have to make the same mistake as me and mistake
SIOCINQ and FIONREAD, I have patched an update to
Documentation/networking/dccp.tx (next email).
Have you got the sources available for the DCCP plugin: it would be
interesting to see how it is used. After the handshake ioctl(FIONREAD)
returns 0 for a while, and same after last read.
If done intelligently, this could solve the End-of-File problem reported
earlier by Remi Denis-Courmont.
^ permalink raw reply [flat|nested] 9+ messages in thread* Re: How much is available for reading on the socket?
2007-10-22 2:00 How much is available for reading on the socket? Łeandro Sales
` (5 preceding siblings ...)
2007-11-15 7:02 ` Gerrit Renker
@ 2007-11-15 7:04 ` Gerrit Renker
2007-11-15 7:52 ` Ian McDonald
7 siblings, 0 replies; 9+ messages in thread
From: Gerrit Renker @ 2007-11-15 7:04 UTC (permalink / raw)
To: dccp
[DCCP]: Update documentation on ioctls
Signed-off-by: Gerrit Renker <gerrit@erg.abdn.ac.uk>
---
Documentation/networking/dccp.txt | 6 ++++++
1 file changed, 6 insertions(+)
--- a/Documentation/networking/dccp.txt
+++ b/Documentation/networking/dccp.txt
@@ -161,6 +161,12 @@ sync_ratelimit = 125 ms
sequence-invalid packets on the same socket (RFC 4340, 7.5.4). The unit
of this parameter is milliseconds; a value of 0 disables rate-limiting.
+IOCTLS
+===
+FIONREAD
+ Works as in udp(7): returns in the `int' argument pointer the size of
+ the next pending datagram in bytes, or 0 when no datagram is pending.
+
Notes
==
^ permalink raw reply [flat|nested] 9+ messages in thread* Re: How much is available for reading on the socket?
2007-10-22 2:00 How much is available for reading on the socket? Łeandro Sales
` (6 preceding siblings ...)
2007-11-15 7:04 ` Gerrit Renker
@ 2007-11-15 7:52 ` Ian McDonald
7 siblings, 0 replies; 9+ messages in thread
From: Ian McDonald @ 2007-11-15 7:52 UTC (permalink / raw)
To: dccp
On 11/15/07, Gerrit Renker <gerrit@erg.abdn.ac.uk> wrote:
> [DCCP]: Update documentation on ioctls
>
> Signed-off-by: Gerrit Renker <gerrit@erg.abdn.ac.uk>
Acked-by: Ian McDonald <ian.mcdonald@jandi.co.nz>
^ permalink raw reply [flat|nested] 9+ messages in thread