If you supply a non-null WriteCallback, exactly one of writeSuccess() or writeErr() will be invoked when the write completes. If you supply the same WriteCallback object for multiple write() calls, it will be invoked exactly once per call. The only way to cancel outstanding write requests is to close the socket (e.g., with closeNow() or shutdownWriteNow()). When closing the socket this way, writeErr() will still be invoked once for each outstanding write operation.
Declared in <folly/io/async/AsyncTransport.h>
virtual
void
writev(
WriteCallback* callback,
iovec const* vec,
size_t count,
WriteFlags flags = WriteFlags::NONE) = 0;
| Name | Description |
|---|---|
| callback | Callback notified when the write completes or fails. |
| vec | Array of iovec entries describing the data to write. |
| count | Number of entries in vec. |
| flags | Flags controlling how the data is written. |