Block on write and block on read both are faced while using pipe after mkfifo. It is a problem because in this situation prompt seems to be hanged and further operations are stopped, so we should have the knowledge of the concept of block on read and block on write.
Block on Write: *if pipe is full.
# If reader is still connected but not reading. As you know pipe follows circular queue concept after filling pipe with data if you're not trying to read then you will have the problem of block on Write.
Block on read : similar concept is applied for it like block on Write but is of opposite manner , below are the points :
*If pipe is empty.
# if writer is still connected but not trying to write.
//In the same way you can make code for reader . when you done with your chat box then make sure to test it completely as I was facing problems while testing it . But now it is working fine. This will make you understand the concept of Block on Read and Block on write.
Make sure you don't receive any garbage value while reading.