diff options
Diffstat (limited to 'src/poll.c')
-rw-r--r-- | src/poll.c | 38 |
1 files changed, 33 insertions, 5 deletions
@@ -850,17 +850,34 @@ int ssh_event_add_session(ssh_event event, ssh_session session) { } /** - * @brief Poll all the sockets and sessions associated through an event object. - * If any of the events are set after the poll, the - * call back functions of the sessions or sockets will be called. - * This function should be called once within the programs main loop. + * @brief Add a connector to the SSH event loop + * + * @param[in] event The SSH event loop + * + * @param[in] connector The connector object + * + * @return SSH_OK + * + * @return SSH_ERROR in case of error + */ +int ssh_event_add_connector(ssh_event event, ssh_connector connector){ + return ssh_connector_set_event(connector, event); +} + +/** + * @brief Poll all the sockets and sessions associated through an event object.i + * + * If any of the events are set after the poll, the call back functions of the + * sessions or sockets will be called. + * This function should be called once within the programs main loop. * * @param event The ssh_event object to poll. + * * @param timeout An upper limit on the time for which the poll will * block, in milliseconds. Specifying a negative value * means an infinite timeout. This parameter is passed to * the poll() function. - * @returns SSH_OK No error. + * @returns SSH_OK on success. * SSH_ERROR Error happened during the poll. */ int ssh_event_dopoll(ssh_event event, int timeout) { @@ -966,6 +983,17 @@ int ssh_event_remove_session(ssh_event event, ssh_session session) { return rc; } +/** @brief Remove a connector from an event context + * @param[in] event The ssh_event object. + * @param[in] connector connector object to remove + * @return SSH_OK on success + * @return SSH_ERROR on failure + */ +int ssh_event_remove_connector(ssh_event event, ssh_connector connector){ + (void)event; + return ssh_connector_remove_event(connector); +} + /** * @brief Free an event context. * |