Lines Matching +full:no +full:- +full:tick +full:- +full:in +full:- +full:suspend

2  * Copyright (c) 2000-2007 Niels Provos <provos@citi.umich.edu>
3 * Copyright (c) 2007-2012 Niels Provos and Nick Mathewson
5 * Redistribution and use in source and binary forms, with or without
10 * 2. Redistributions in binary form must reproduce the above copyright
11 * notice, this list of conditions and the following disclaimer in the
19 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
23 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
39 drained automatically. The user of a bufferevent no longer deals
52 Bufferevents come in several flavors, including:
55 <dt>Socket-based bufferevents</dt>
69 <dt>SSL-backed bufferevents</dt>
83 #include <event2/event-config.h>
104 #define BEV_EVENT_TIMEOUT 0x40 /**< user-specified timeout reached */
125 The read callback is triggered when new data arrives in the input
133 @param ctx the user-specified context for this bufferevent
152 @param ctx the user-specified context for this bufferevent
166 /** If set, callbacks are run deferred in the event loop. */
182 It is safe to set the fd to -1, so long as you later
193 Launch a connect() attempt with a socket-based bufferevent.
201 If no address is provided, we assume that the socket is already connecting,
209 @return 0 on success, -1 on failure.
223 AF_UNSPEC for no preference. Only AF_INET, AF_INET6, and AF_UNSPEC are
228 @return 0 if successful, -1 on failure.
264 @return 0 if successful, or -1 if an error occurred
283 @return 0 if successful, or -1 if an error occurred
313 no callback is desired
315 writing, or NULL if no callback is desired
359 Returns the file descriptor associated with a bufferevent, or -1 if
360 no file descriptor is associated with the bufferevent.
367 the bufferevent is a wrapper), or NULL if there is no underlying bufferevent.
381 @param size the length of the data, in bytes
382 @return 0 if successful, or -1 if an error occurred
396 @return 0 if successful, or -1 if an error occurred
410 @param size the size of the data buffer, in bytes
411 @return the amount of data read, in bytes.
422 @return 0 if successful, or -1 if an error occurred.
459 @return 0 if successful, or -1 if an error occurred
470 @return 0 if successful, or -1 if an error occurred
492 (In other words, if reading or writing is disabled, or if the
494 there's no data to write, or not enough bandwidth, or so on, the
502 EV_WRITE) becomes disabled until you re-enable it again. The
519 there is at least low watermark data in the buffer. If the read buffer
522 limit (typical example is openssl bufferevent), so you should not relay in
542 Returns non-zero if events contains not only EV_READ or EV_WRITE.
555 Acquire the lock on a bufferevent. Has no effect if locking was not
562 Release the lock on a bufferevent. Has no effect if locking was not
571 * this is useful in situations where a user may reference the bufferevent
583 * Warning: make sure you know what you're doing. This is mainly used in
615 @return -1 on failure, 0 if no data was produces, 1 if data was produced
680 /** the filter encountered a critical error, no further data
691 it will overflow the high-water mark associated with dst.
692 -1 means "no limit".
695 or flush as much as we can, possibly including an end-of-stream
697 @param ctx A user-supplied pointer.
733 socketpair(), except that no internal socketpair is allocated.
738 @return 0 on success, -1 on failure.
752 Abstract type used to configure rate-limiting on a bufferevent or a group
763 /** Maximum configurable rate- or burst-limit. */
767 Initialize and return a new object to configure the rate-limiting behavior
770 @param read_rate The maximum number of bytes to read per tick on
772 @param read_burst The maximum number of bytes to read in any single tick.
773 @param write_rate The maximum number of bytes to write per tick on
775 @param write_burst The maximum number of bytes to write in any single tick.
776 @param tick_len The length of a single tick. Defaults to one second.
779 Note that all rate-limits hare are currently best-effort: future versions
788 /** Free all storage held in 'cfg'.
790 Note: 'cfg' is not currently reference-counted; it is not safe to free it
791 until no bufferevent is using it.
797 Set the rate-limit of a the bufferevent 'bev' to the one specified in
798 'cfg'. If 'cfg' is NULL, disable any per-bufferevent rate-limiting on
801 Note that only some bufferevent types currently respect rate-limiting.
802 They are: socket-based bufferevents (normal and IOCP-based), and SSL-based
805 Return 0 on success, -1 on failure.
812 Create a new rate-limit group for bufferevents. A rate-limit group
813 constrains the maximum number of bytes sent and received, in toto,
817 Note that all bufferevents in the group do not necessarily need to share
819 @param cfg The rate-limit for this group.
821 Note that all rate-limits hare are currently best-effort: future versions
824 Note also that only some bufferevent types currently respect rate-limiting.
825 They are: socket-based bufferevents (normal and IOCP-based), and SSL-based
833 Change the rate-limiting settings for a given rate-limiting group.
835 Return 0 on success, -1 on failure.
844 bufferevent in a group for reading or writing at a time.
847 behavior, if a rate-limiting group is so tight on bandwidth that you're
848 only willing to send 1 byte per tick per bufferevent, you might instead
850 1/N of the bufferevents (chosen at random) each tick, so you still wind
851 up send 1 byte per tick per bufferevent on average, but you don't send
854 The default min-share is currently 64 bytes.
856 Returns 0 on success, -1 on failure.
863 Free a rate-limiting group. The group must have no members when
873 A bufferevent may belong to no more than one rate-limit group at a time.
877 Return 0 on success and -1 on failure.
883 /** Remove 'bev' from its current rate-limit group (if any). */
892 Return 0 on success and -1 on failure.
902 Return 0 on success and -1 on failure.
919 If it is not configured with a per-bufferevent ratelimit, return
944 group. Note that it can return a negative value if bufferevents in
963 bufferevent will resume or suspend reading writing as appropriate.
964 These functions make no change in the buckets for the bufferevent's
967 Returns 0 on success, -1 on internal error.
980 Subtract a number of bytes from a bufferevent rate-limiting group's
983 above or below zero, the bufferevents in the group will resume or
984 suspend reading writing as appropriate.
986 Returns 0 on success, -1 on internal error.