@@ -123,20 +123,6 @@ class WiFiClient : public Client {
123123 */
124124 virtual int read ();
125125
126- /* *
127- * @brief Reads multiple bytes of data from the server into a buffer.
128- *
129- * This function retrieves data from the server's receive buffer and stores it
130- * into the provided array. It attempts to read up to the specified number of
131- * bytes (`size`). The function stops reading if no more data is available or
132- * if an error occurs.
133- *
134- * @param[out] buf Pointer to the buffer where the data will be stored.
135- * @param[in] size Maximum number of bytes to read.
136- * @return The number of bytes successfully read into the buffer.
137- * Returns `0` if no data is available or if the socket is invalid.
138- */
139-
140126 /* *
141127 * @brief Reads multiple bytes of data from the server into a buffer.
142128 *
@@ -151,27 +137,33 @@ class WiFiClient : public Client {
151137 * Returns `0` if no data is available or if the socket is invalid.
152138 */
153139 virtual int read (uint8_t *buf, size_t size);
154-
140+
155141 /* *
156142 * @brief Peeks at the next byte of incoming data without removing it from the internal buffer.
143+ *
144+ * @return The next byte as an `int` (0–255). Returns `-1` if no data is available
145+ * or if the socket is invalid.
157146 */
158147 virtual int peek ();
159148
160149 /* *
161- * @brief Clears any buffered outgoing data that has not been sent to the connected client.
150+ * @brief Flushes the write buffer of the client.
151+ *
152+ * This function ensures that any data buffered for transmission is sent to the
153+ * connected server. If there is any pending data in the send buffer, it is
154+ * transmitted over the network.
162155 */
163156 virtual void flush ();
164157
165158 /* *
166- * @brief Closes the connection to the remote server
167- * and releases any resources associated with it.
159+ * @brief Closes the connection to the server and clears the receive buffer.
168160 */
169161 virtual void stop ();
170162
171163 /* *
172- * @brief Checks whether the client is currently connected to a remote server.
164+ * @brief Checks if the client is connected to a server.
173165 *
174- * @return Returns a `uint8_t` value indicating the connection status of the client .
166+ * @return Returns 1 if the client is connected, 0 otherwise .
175167 */
176168 virtual uint8_t connected ();
177169
@@ -185,19 +177,23 @@ class WiFiClient : public Client {
185177 };
186178
187179 /* *
188- * @return Returns the IP address of the remote server to which the client is connected.
180+ * @brief Retrieves the remote IP address of the server the client is connected to.
181+ *
182+ * @return The IP address of the remote server. If not connected, returns IPAddress(0, 0, 0, 0).
189183 */
190184 virtual IPAddress remoteIP ();
191185
192186 /* *
193- * @return Returns the port number of the remote server for the connetec client.
187+ * @brief Retrieves the remote port number of the server the client is connected to.
188+ *
189+ * @return Returns the port number of the remote server. If not connected, returns 0.
194190 */
195191 virtual uint16_t remotePort ();
196192
197193 /* *
198- * @brief Sets the connection timeout value for the client.
199- * @param It takes an integer `timeout` as a parameter which determines how long the
200- * client will wait for a connection to be established before timing out .
194+ * @brief Sets the connection timeout for the client.
195+ *
196+ * @param `timeout` is the timeout value in milliseconds .
201197 */
202198 void setConnectionTimeout (int timeout) {
203199 _connectionTimeout = timeout;
0 commit comments