Lines Matching +full:write +full:- +full:data

2  * Copyright (c) 2000-2007 Niels Provos <provos@citi.umich.edu>
3 * Copyright (c) 2007-2012 Niels Provos and Nick Mathewson
22 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
33 Functions for buffering data for network sending or receiving. Bufferevents
48 When writing is enabled, the bufferevent will try to write data onto its
49 file descriptor when the output buffer has enough data, and call the write
55 <dt>Socket-based bufferevents</dt>
56 <dd>A bufferevent that reads and writes data onto a network
60 <dd>A pair of bufferevents that send and receive data to one
65 <dd>A bufferevent that transforms data, and sends or receives it
69 <dt>SSL-backed bufferevents</dt>
71 receive data over an encrypted connection. Created with
83 #include <event2/event-config.h>
104 #define BEV_EVENT_TIMEOUT 0x40 /**< user-specified timeout reached */
123 A read or write callback for a bufferevent.
125 The read callback is triggered when new data arrives in the input
126 buffer and the amount of readable data exceed the low watermark
129 The write callback is triggered if the write buffer has been
133 @param ctx the user-specified context for this bufferevent
148 to indicate if the error was encountered on the read or write path,
152 @param ctx the user-specified context for this bufferevent
180 @param fd the file descriptor from which data is read and written to.
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.
209 @return 0 on success, -1 on failure.
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
299 If there is pending data to write on the bufferevent, it probably won't be
312 @param readcb callback to invoke when there is data to be read, or NULL if
334 current write callback for the bufferevent.
359 Returns the file descriptor associated with a bufferevent, or -1 if
373 Write data to a bufferevent buffer.
375 The bufferevent_write() function can be used to write data to the file
376 descriptor. The data is appended to the output buffer and written to the
380 @param data a pointer to the data to be written
381 @param size the length of the data, in bytes
382 @return 0 if successful, or -1 if an error occurred
387 const void *data, size_t size);
391 Write data from an evbuffer to a bufferevent buffer. The evbuffer is
396 @return 0 if successful, or -1 if an error occurred
404 Read data from a bufferevent buffer.
406 The bufferevent_read() function is used to read data from the input buffer.
409 @param data pointer to a buffer that will store the data
410 @param size the size of the data buffer, in bytes
411 @return the amount of data read, in bytes.
414 size_t bufferevent_read(struct bufferevent *bufev, void *data, size_t size);
417 Read data from a bufferevent buffer into an evbuffer. This avoids
421 @param buf the evbuffer to which to add data
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
486 Set the read and write timeout for a bufferevent.
489 amount of time has elapsed since a successful read or write operation,
490 during which the bufferevent was trying to read or write.
493 bufferevent's read or write operation has been suspended because
494 there's no data to write, or not enough bandwidth, or so on, the
496 willing to actually read or write.)
502 EV_WRITE) becomes disabled until you re-enable it again. The
509 @param timeout_write the write timeout, or NULL
516 Sets the watermarks for read and write events.
519 there is at least low watermark data in the buffer. If the read buffer
525 On output, the user write callback is invoked whenever the buffered data
526 falls below the low watermark. Filters that write to this bufev will try
527 not to write more bytes to this buffer than the high watermark would allow,
541 Retrieves the watermarks for read or write events.
542 Returns non-zero if events contains not only EV_READ or EV_WRITE.
584 * conjunction with bufferevent_incref(). This will free up all data associated
596 deal with the incoming data.
599 /** usually set when processing data */
602 /** want to checkpoint all data sent. */
605 /** encountered EOF on read or done sending data */
610 Triggers the bufferevent to produce more data if possible.
615 @return -1 on failure, 0 if no data was produces, 1 if data was produced
638 Triggers bufferevent data callbacks.
677 /** the filter needs to read more data before output */
680 /** the filter encountered a critical error, no further data
687 @param src An evbuffer to drain data from.
688 @param dst An evbuffer to add data to.
689 @param limit A suggested upper bound of bytes to write to dst.
691 it will overflow the high-water mark associated with dst.
692 -1 means "no limit".
693 @param mode Whether we should write data as may be convenient
694 (BEV_NORMAL), or flush as much data as we can (BEV_FLUSH),
695 or flush as much as we can, possibly including an end-of-stream
697 @param ctx A user-supplied pointer.
699 @return BEV_OK if we wrote some data; BEV_NEED_MORE if we can't
711 @param input_filter The filter to apply to data we read from the underlying
713 @param output_filter The filer to apply to data we write to the underlying
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
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.
779 Note that all rate-limits hare are currently best-effort: future versions
790 Note: 'cfg' is not currently reference-counted; it is not safe to free 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
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.
847 behavior, if a rate-limiting group is so tight on bandwidth that you're
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.
898 Set the size limit for single write operation.
902 Return 0 on success and -1 on failure.
911 /** Get the current size limit for single write operation. */
918 Return the current read or write bucket size for a bufferevent.
919 If it is not configured with a per-bufferevent ratelimit, return
922 made to read or write more than its limit.
943 Return the read or write bucket size for a bufferevent rate limit
945 the group have been made to read or write more than their limits.
960 Subtract a number of bytes from a bufferevent's read or write bucket.
967 Returns 0 on success, -1 on internal error.
980 Subtract a number of bytes from a bufferevent rate-limiting group's
981 read or write bucket. The decrement value can be negative, if you
986 Returns 0 on success, -1 on internal error.