Skip to content

Instantly share code, notes, and snippets.

@piscisaureus
Forked from ry/uv-ipc.c
Created September 21, 2011 23:13
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save piscisaureus/1233593 to your computer and use it in GitHub Desktop.
typedef struct uv_ipc_s uv_ipc_t;
/* uv_ipc_t is a subclass of uv_stream_t */
struct uv_ipc_s {
UV_HANDLE_FIELDS
UV_STREAM_FIELDS
UV_IPC_PRIVATE_FIELDS
};
typedef struct uv_process_options_s {
/* ... add the following */
uv_ipc_t* channel;
};
/*
* Called from child.
*
* This may be called exactly once per child process. Returns zero on success.
*/
int uv_ipc_init(uv_loop_t*, uv_ipc_t*);
/*
* Called from child.
*
* This should be called from the read_cb to determine if there is a pending
* incoming handle. If so this function returns the type of that pending
* incoming handle. If there is no pending incoming then this returns
* UV_UNKNOWN.
* uv_accept() should be used when there is a pending connection.
*/
uv_handle_type uv_ipc_pending(uv_ipc_t*);
/*
* Called from parent or child.
*
* sends the given stream to the other process.
*/
void uv_ipc_send(uv_ipc_t*, uv_stream_t*);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment