RE: Socket buffer usage


-----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


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
To unsubscribe, send any mail to "freebsd-hackers-

freebsd-hackers@xxxxxxxxxxx mailing list
To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@xxxxxxxxxxx"

Relevant Pages

  • 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 ...
  • 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. ...
  • 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 ...
  • 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 ...
  • 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, ...