Find the answer to your Linux question:
Results 1 to 3 of 3
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 ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Aug 2011
    Posts
    2

    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
    Linux Newbie
    Join Date
    Nov 2009
    Posts
    218
    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
    Just Joined!
    Join Date
    Aug 2011
    Posts
    2
    Thanks - I'll give that a try.

Posting Permissions

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