Programming quiz:

1. Create a GMainLoop.

2. Use socketpair(), wrap “server” side descriptor into a GSocket. Write some data.

4. Spawn a new process, passing the “client” side descriptor. This process also creates a GMainLoop and wraps the descriptor into a GSocket.

3. Server runs the main loop.

5. Client create sa GSource for the socket, to get async notifications on “data ready”, and starts its main loop.

The data written by the server process never triggers “data ready”. Where's my data?

Adrián Pérez
Follow

Of course, writing the data is successful and produces no errors. Theoretically the data should be buffered somewhere by the kernel, as the socket pair is expected to behave like a FIFO pipe. Any ideas?

I would really like to send an initial message over the socketpair which the spawned process would read right away on startup.

Sign in to participate in the conversation
Mastodon

Follow friends and discover new ones. Publish anything you want: links, pictures, text, video. This server is run by the main developers of the Mastodon project. Everyone is welcome as long as you follow our code of conduct!