RE: Socket buffer usage



ioctl(FIONREAD)

-----Original Message-----
From: owner-freebsd-hackers@xxxxxxxxxxx [mailto:owner-freebsd-
hackers@xxxxxxxxxxx] On Behalf Of Ivan Voras
Sent: Sunday, April 08, 2012 6:17 AM
To: freebsd-hackers
Subject: Socket buffer usage

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@xxxxxxxxxxx mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to "freebsd-hackers-
unsubscribe@xxxxxxxxxxx"

_______________________________________________
freebsd-hackers@xxxxxxxxxxx mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@xxxxxxxxxxx"



Relevant Pages

  • Re: strange select() behavior
    ... sharing descriptors, might fill that interface buffer. ... What do you do when a blocking socket operation returns ENOBUFS? ... because it's a semantic change. ...
    (comp.unix.programmer)
  • Re: Communication speed between blocking call and non blocking cal
    ... You could use event based notification, ... When you use nonblocking I/O, the system may have to perform extra buffering ... data buffer until you say that you are done with it. ... I checked default socket buffer ...
    (microsoft.public.win32.programmer.networks)
  • Re: Can someone help me
    ... // contents from the server to the client public class AsynchNetworkFileServer {class ClientHandler {// constructor public ClientHandler(Socket socketForClient) {// initialize member variable socket = socketForClient; // initialize buffer to hold ... // contents of file buffer = new byte; // create the network stream networkStream = new NetworkStream; // set the file callback for reading ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: [PATCH] CONFIG_PACKET_MMAP should depend on MMU
    ... The entire data buffer is allocated as one contiguous lump in NOMMU-mode. ... +#ifndef CONFIG_MMU ... * find out where the socket buffers are so that NOMMU mmap can return the ...
    (Linux-Kernel)
  • Re: Socket stuck with puts over ADSL line
    ... gets stuck with the puts command within the filevent writeable ... Is the socket configured as -blocking 1? ... local buffer would fill rapidly, ... buffered portion across the WAN as its own TCP packet, ...
    (comp.lang.tcl)