コード例 #1
0
ファイル: s2n_connection.c プロジェクト: siwuxian/s2n
int s2n_shutdown(struct s2n_connection *conn, int *more)
{
    /* Write any pending I/O */
    GUARD(s2n_flush(conn, more));

    GUARD(s2n_queue_writer_close_alert(conn));

    /* Write the alert message out */
    GUARD(s2n_flush(conn, more));

    /* Wipe the connection */
    GUARD(s2n_connection_wipe(conn));

    return 0;
}
コード例 #2
0
ファイル: s2n_connection.c プロジェクト: ntc2/s2n
int s2n_shutdown(struct s2n_connection *conn, s2n_blocked_status *more)
{
    uint64_t elapsed;

    GUARD(s2n_timer_elapsed(conn->config, &conn->write_timer, &elapsed));
    if (elapsed < conn->delay) {
        S2N_ERROR(S2N_ERR_SHUTDOWN_PAUSED);
    }

    /* Write any pending I/O */
    GUARD(s2n_flush(conn, more));

    GUARD(s2n_queue_writer_close_alert(conn));

    /* Write the alert message out */
    GUARD(s2n_flush(conn, more));

    /* Wipe the connection */
    GUARD(s2n_connection_wipe(conn));

    return 0;
}