Find the answer to your Linux question:
Results 1 to 3 of 3
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1

    determining how full a named pipe is

    I believe that named pipes have a maximum size - as I recall the max size increased via some recent kernel release.

    Anyway - my application is I have a task that connects with a remote server and receives lines of text... I process the text and send it on to another task on my server that parses the text and makes some database entries.

    I would like to monitor the 'fullness' of the named pipe because if it starts to get to the point of being full I'd like to know - I may be able to throttle the data rate from the upstream server or I may decide to use more than one pipe but without knowing if there is a problem.....

    So how do I monitor the named pipe? Much of my work uses php 5.3 but a native linux solution or something in c++ would be ok. I'm using Ubuntu 11 server

  2. #2
    Hello Roy,

    Look up the select() man entry.

    This will enable you to determine if the pipe is available to write to.

    Set up the pipe as non-blocking. You can then test the result of any "write" you attempt. If you get the error "EWOULDBLOCK", then the pipe is unable to handle the current write.

  3. #3
    Thanks - I'll give that a try.

  4. $spacer_open

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts