@@ -123,20 +123,6 @@ class WiFiClient : public Client {
123
123
*/
124
124
virtual int read ();
125
125
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
-
140
126
/* *
141
127
* @brief Reads multiple bytes of data from the server into a buffer.
142
128
*
@@ -151,27 +137,33 @@ class WiFiClient : public Client {
151
137
* Returns `0` if no data is available or if the socket is invalid.
152
138
*/
153
139
virtual int read (uint8_t *buf, size_t size);
154
-
140
+
155
141
/* *
156
142
* @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.
157
146
*/
158
147
virtual int peek ();
159
148
160
149
/* *
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.
162
155
*/
163
156
virtual void flush ();
164
157
165
158
/* *
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.
168
160
*/
169
161
virtual void stop ();
170
162
171
163
/* *
172
- * @brief Checks whether the client is currently connected to a remote server.
164
+ * @brief Checks if the client is connected to a server.
173
165
*
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 .
175
167
*/
176
168
virtual uint8_t connected ();
177
169
@@ -185,19 +177,23 @@ class WiFiClient : public Client {
185
177
};
186
178
187
179
/* *
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).
189
183
*/
190
184
virtual IPAddress remoteIP ();
191
185
192
186
/* *
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.
194
190
*/
195
191
virtual uint16_t remotePort ();
196
192
197
193
/* *
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 .
201
197
*/
202
198
void setConnectionTimeout (int timeout) {
203
199
_connectionTimeout = timeout;
0 commit comments