Advertisement

multi send

Started by April 07, 2004 06:24 PM
2 comments, last by dioetyr 20 years, 10 months ago
Hi I''m using bsd sockets for my app. I have forked like this: clientSocket = accept(.....); pid = fork(); after that i want to do a send(...); to all my connected clients. How do I do that? I can''t do a send(clientSocket, .....); because it will only go to that fork. Any suggestions?
Don''t fork.

Or keep a pipe (or socket) between your client and the process calling accept(), and have that master process do the sending to all clients.

But I''d suggest not forking.
enum Bool { True, False, FileNotFound };
Advertisement
Hi
If i''m not going to fork how am I going to allow multipleconnections?
Off the top of my head you can either use select() or pthreads.

This topic is closed to new replies.

Advertisement