Hello friends,

Here my aim is one of my server program rights on to the fifo when some information available and
the client program which reads the data from the fifo needs to wait for some time period ( ex 5 sec ) once it reaches that time , client needs to come out of that waitig state .

my server program is like below.
Code:
#include <stdio.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <string.h>

#define BUF_LEN 256

int main()
{
        int cliFd;
        char buf[] ="Hello" ;
        int cnt=5;


        printf("%s",buf);

        printf("Open Sent Reponse message \n");

        cliFd = open("/home/rama/test",O_WRONLY);
        printf("%d",cliFd);

        if (cliFd)
        {
                printf("Sent Reponse message \n");
        //      write(cliFd,buf,cnt);
                sleep(3);
                close(cliFd);
                printf("close Sent Reponse message \n");
        }

        return 0;
}
my client program is like below

Code:
#include <stdio.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <string.h>

#define BUF_LEN 256

int main()
{
        int cliFd;
        char buf[] ="Hello" ;
        int cnt=5;


        printf("%s",buf);

        printf("Open Sent Reponse message \n");

        cliFd = open("/home/rama/test",O_WRONLY);
        printf("%d",cliFd);

        if (cliFd)
        {
                printf("Sent Reponse message \n");
        //      write(cliFd,buf,cnt);
                sleep(3);
                close(cliFd);
                printf("close Sent Reponse message \n");
        }

        return 0;
}

Here my concerns are like below

1) In this program client program is not going to select system call untill and unless server program opens the fifo for wring and closes it.

2) my requirement is once server program opens for writing the client program execution should stop at the select system call wating either for timer expire or any data recevied from FIFO.

can any body guide me where am i missing to reach out to my goal

thanks and regards