Register
It is currently Wed Nov 26, 2014 9:01 am

Non-blocking pipe


All times are UTC - 6 hours


Post new topic Reply to topic  [ 1 post ] 
Author Message
 PostPosted: Mon Feb 09, 2009 1:29 pm   

Joined: Mon Feb 09, 2009 8:30 am
Posts: 1
Hello,
Would this be an acceptable way of creating a non-blocking pipe.
Basically I want to create kind of a server client arch.

This code would be in the server, and I don't want to have to wait for
clients to read before moving on to the next client. One problem I
can see is if a client leaves/dies and never reads from the pipe(but I
could have some trap/cleanup stuff in the clients for that).

# assigning fd 3 to the pipe
echo "exec 3>myfifo && echo 'a' >&3 && echo 'b' >&3 && echo 'c' >&3 &&
exec 3>&-" | at now

Please let me know if you have any suggestions. This code is based of
the faq http://wooledge.org:8000/BashFAQ/085.
Thanks,

Chris.


Top
 Profile  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1 post ] 

All times are UTC - 6 hours


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  


BashScripts | Promote Your Page Too
Powered by phpBB © 2011 phpBB Group
© 2003 - 2011 USA LINUX USERS GROUP