void ws_listen_socket(Socket s) { XtInputId id; id = XtAppAddInput(pceXtAppContext(NULL), s->rdfd, (XtPointer)(XtInputReadMask), ws_accept, s); setXtInputIdStream((Stream) s, id); }
void ws_input_stream(Stream s) { if ( s->rdfd >= 0 ) { XtInputId id; id = XtAppAddInput(pceXtAppContext(NULL), s->rdfd, (XtPointer)(XtInputReadMask), ws_handle_stream_data, s); setXtInputIdStream(s, id); DEBUG(NAME_stream, Cprintf("Registered %s for asynchronous input\n", pp(s))); } }
static int setup(void) { if ( context.pipe[0] > 0 ) return TRUE; DLOCK(); if ( context.pipe[0] == -1 ) { if ( pipe(context.pipe) == -1 ) { DUNLOCK(); return PL_resource_error("open_files"); } context.id = XtAppAddInput(pceXtAppContext(NULL), context.pipe[0], (XtPointer)(XtInputReadMask), on_input, &context); } DUNLOCK(); return TRUE; }