Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 7 Apr 2012 22:36:08 +0100
From:      Vlad Galu <dudu@dudu.ro>
To:        Ivan Voras <ivoras@freebsd.org>
Cc:        freebsd-hackers <freebsd-hackers@freebsd.org>
Subject:   Re: Socket buffer usage
Message-ID:  <0D2E65B3D0AB4A6483C26A613FC73F83@dudu.ro>
In-Reply-To: <CAF-QHFWV%2ByV3VwY3dhhxzi4=xwrJcUDULW=PyJxQH8Vb=61%2BSw@mail.gmail.com>
References:  <CAF-QHFWV%2ByV3VwY3dhhxzi4=xwrJcUDULW=PyJxQH8Vb=61%2BSw@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
This might not exactly be what you want, but struct kevent has a member called "data" which, for sockets and pipes, returns the number of available bytes to read (or write) for EVFILT_READ (or EVFILT_READ) events. 

-- 
Good, fast and cheap: pick any two.


On Saturday, April 7, 2012 at 10:16 PM, Ivan Voras wrote:

> Hi,
> 
> I'm tracking down an obscure bug in my userland program and it might
> have something to do with the way I write&read data through a (Unix
> domain) socket. I'm setting SO_SNDBUF and SO_RCVBUF, and what I'm
> looking for is some way to query the amount of TX & RX buffered / free
> data on a socket. Is there something I can use? I'll even accept
> inspecting kernel structures if explained in detail and can be done on
> a running system.
> 
> Alternatively, is there anything else which could cause poll(2) with
> POLLOUT on a socket to return no events ready on such a socket? (my
> expectation being that a socket is always ready to be written to if
> there is buffer space free...).
> _______________________________________________
> freebsd-hackers@freebsd.org (mailto:freebsd-hackers@freebsd.org) mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
> To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@freebsd.org (mailto:freebsd-hackers-unsubscribe@freebsd.org)"






Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?0D2E65B3D0AB4A6483C26A613FC73F83>