From 5bf58211387946fde4d3e362c3d05a814321cbbd Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Sun, 22 Jul 2018 13:01:14 -0700 Subject: [PATCH] Cleanup docs in uv::Stream and uv::Tcp (#1207) --- wpiutil/src/main/native/include/wpi/uv/Stream.h | 12 +++++++----- wpiutil/src/main/native/include/wpi/uv/Tcp.h | 12 ++++++------ 2 files changed, 13 insertions(+), 11 deletions(-) diff --git a/wpiutil/src/main/native/include/wpi/uv/Stream.h b/wpiutil/src/main/native/include/wpi/uv/Stream.h index cd518919bb..28e2ef707f 100644 --- a/wpiutil/src/main/native/include/wpi/uv/Stream.h +++ b/wpiutil/src/main/native/include/wpi/uv/Stream.h @@ -97,6 +97,8 @@ class Stream : public Handle { /** * Start reading data from an incoming stream. * + * This will only succeed after a connection has been established. + * * A data signal will be emitted several times until there is no more * data to read or `StopRead()` is called. * An end signal will be emitted when there is no more data to read. @@ -119,9 +121,9 @@ class Stream : public Handle { * the data and use either its Complete() function or destructor to free the * data. * - * HandleWriteComplete() will be called on the request object when the data - * has been written. HandleWriteComplete() is called even if an error occurs. - * HandleError() will be called on the request object in case of errors. + * The finish signal will be emitted on the request object when the data + * has been written (or if an error occurs). + * The error signal will be emitted on the request object in case of errors. * * @param bufs The buffers to be written to the stream. * @param req write request @@ -135,8 +137,8 @@ class Stream : public Handle { * the `bufs` parameter must exceed the lifetime of the write request. * The callback can be used to free data after the request completes. * - * The callback will be called when the data has been written. Errors will - * be reported to the stream error handler. + * The callback will be called when the data has been written (even if an + * error occurred). Errors will be reported to the stream error handler. * * @param bufs The buffers to be written to the stream. * @param callback Callback function to call when the write completes diff --git a/wpiutil/src/main/native/include/wpi/uv/Tcp.h b/wpiutil/src/main/native/include/wpi/uv/Tcp.h index 08e6a7135a..067c0fdc09 100644 --- a/wpiutil/src/main/native/include/wpi/uv/Tcp.h +++ b/wpiutil/src/main/native/include/wpi/uv/Tcp.h @@ -225,9 +225,9 @@ class Tcp final : public NetworkStreamImpl { * (`0.0.0.0` or `::`) it will be changed to point to localhost. This is * done to match the behavior of Linux systems. * - * HandleConnected() is called on the request when the connection has been + * The connected signal is emitted on the request when the connection has been * established. - * HandleError() is called on the request in case of errors during the + * The error signal is emitted on the request in case of errors during the * connection. * * @param addr Initialized `sockaddr_in` or `sockaddr_in6` data structure. @@ -275,9 +275,9 @@ class Tcp final : public NetworkStreamImpl { * (`0.0.0.0` or `::`) it will be changed to point to localhost. This is * done to match the behavior of Linux systems. * - * HandleConnected() is called on the request when the connection has been + * The connected signal is emitted on the request when the connection has been * established. - * HandleError() is called on the request in case of errors during the + * The error signal is emitted on the request in case of errors during the * connection. * * @param ip The address to which to connect to. @@ -311,9 +311,9 @@ class Tcp final : public NetworkStreamImpl { * (`0.0.0.0` or `::`) it will be changed to point to localhost. This is * done to match the behavior of Linux systems. * - * HandleConnected() is called on the request when the connection has been + * The connected signal is emitted on the request when the connection has been * established. - * HandleError() is called on the request in case of errors during the + * The error signal is emitted on the request in case of errors during the * connection. * * @param ip The address to which to connect to.