Hi, I'm trying to create a simple distributed system model in C where a central controller regulates the communication between several machines. The controller's job is firstly spawning client process in several hosts.

In my understanding to do this you needs to have a connection with the target host but the target host must already have a process in the first place (TCP socket programming).

Is there any alternative to creating a process (I'm going to use fork() and execl() to do this) in remote machine hosts?

Recommended Answers

All 2 Replies

The way you describe it, no. You cannot fork into another system.
Usually you may assume that a target is running xinetd or some equivalent, and that it is properly configured. It will do the forking and execing on your behalf. Man xinetd and xinetd.conf.

you could have your master broadcast a UDP packet that the clients will be looking for and that can start what ever you want them to do.

but yes, you will have to assume the clients have some amount of preconfiguration already done, and a process running that looks for network activity.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.