socket programing-problem with server

hi,
i am new to socket programming.i have a problem in server.requirement is it should continuosly read the requests from client(sends requests continuously) and after certain delay(i kept der sleep) should send response.

for this i used msgqueues so that after reading it is sending into que.here i started one thread to receive from que and send it to client.
Now, the problem is if i keep sleep() before while only for the first time it is waiting and after that continously sending...
if i keep sleep inside while it is receiving only one message at a time...
please help me in solving this...

Thanks in advance.
Regards,
chandini

Hi chandinisree,
I think is better to setup a concurrent response socket server. This is a parent process creating a child process per client request. Then each child can sleep the time you need. See examples on concurrent socket response in a good book like "UNIX Network Programming" by Richard Stevens.

Hope this helps.

VicK