diff options
author | Aris Adamantiadis <aris@0xbadc0de.be> | 2011-10-10 23:04:06 +0200 |
---|---|---|
committer | Andreas Schneider <asn@cryptomilk.org> | 2016-05-02 16:58:47 +0200 |
commit | 9b3648ded00b05412e63a3260c7baf605d03e75f (patch) | |
tree | 429abf2d7c1d72d181a2c45b93c685729b01c36a /src/poll.c | |
parent | 0701745cbcebd8a378814b5f61cbfa1723465fb6 (diff) | |
download | libssh-9b3648ded00b05412e63a3260c7baf605d03e75f.tar.gz libssh-9b3648ded00b05412e63a3260c7baf605d03e75f.tar.xz libssh-9b3648ded00b05412e63a3260c7baf605d03e75f.zip |
connector: Implement ssh_connector_except()
Signed-off-by: Aris Adamantiadis <aris@0xbadc0de.be>
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
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. * |