@@ -38,7 +38,7 @@ class Socket {
38
38
* Closes any open connection and deallocates any memory associated
39
39
* with the socket. Called from destructor if socket is not closed.
40
40
*
41
- * @return 0 on success, negative error code on failure
41
+ * @return NSAPI_ERROR_OK on success, negative error code on failure
42
42
*/
43
43
virtual nsapi_error_t close () = 0;
44
44
@@ -54,7 +54,7 @@ class Socket {
54
54
* object have to be in the address parameter.
55
55
*
56
56
* @param address The SocketAddress of the remote peer
57
- * @return 0 on success, negative error code on failure
57
+ * @return NSAPI_ERROR_OK on success, negative error code on failure
58
58
*/
59
59
virtual nsapi_error_t connect (const SocketAddress &address) = 0;
60
60
@@ -142,10 +142,11 @@ class Socket {
142
142
143
143
/* * Bind a specific address to a socket.
144
144
*
145
- * Binding assigns a local address to a socket.
145
+ * Binding a socket specifies the address and port on which to receive
146
+ * data. If the IP address is zeroed, only the port is bound.
146
147
*
147
148
* @param address Local address to bind
148
- * @return 0 on success, negative error code on failure.
149
+ * @return NSAPI_ERROR_OK on success, negative error code on failure.
149
150
*/
150
151
virtual nsapi_error_t bind (const SocketAddress &address) = 0;
151
152
@@ -190,7 +191,7 @@ class Socket {
190
191
* such functionality. The exact timing of when the registered function
191
192
* is called is not guaranteed and susceptible to change.
192
193
*
193
- * @param func Function to call on state change
194
+ * @param func Function to call on state change.
194
195
*/
195
196
virtual void sigio (mbed::Callback<void ()> func) = 0;
196
197
@@ -203,11 +204,11 @@ class Socket {
203
204
* For unsupported options, NSAPI_ERROR_UNSUPPORTED is returned
204
205
* and the socket is unmodified.
205
206
*
206
- * @param level Stack-specific protocol level or nsapi_socket_level_t
207
- * @param optname Level-specific option name
208
- * @param optval Option value
209
- * @param optlen Length of the option value
210
- * @return 0 on success, negative error code on failure
207
+ * @param level Stack-specific protocol level or nsapi_socket_level_t.
208
+ * @param optname Level-specific option name.
209
+ * @param optval Option value.
210
+ * @param optlen Length of the option value.
211
+ * @return NSAPI_ERROR_OK on success, negative error code on failure.
211
212
*/
212
213
virtual nsapi_error_t setsockopt (int level, int optname, const void *optval, unsigned optlen) = 0;
213
214
@@ -220,11 +221,11 @@ class Socket {
220
221
* For unsupported options, NSAPI_ERROR_UNSUPPORTED is returned
221
222
* and the socket is unmodified.
222
223
*
223
- * @param level Stack-specific protocol level or nsapi_socket_level_t
224
- * @param optname Level-specific option name
225
- * @param optval Destination for option value
226
- * @param optlen Length of the option value
227
- * @return 0 on success, negative error code on failure
224
+ * @param level Stack-specific protocol level or nsapi_socket_level_t.
225
+ * @param optname Level-specific option name.
226
+ * @param optval Destination for option value.
227
+ * @param optlen Length of the option value.
228
+ * @return NSAPI_ERROR_OK on success, negative error code on failure.
228
229
*/
229
230
virtual nsapi_error_t getsockopt (int level, int optname, void *optval, unsigned *optlen) = 0;
230
231
@@ -250,7 +251,7 @@ class Socket {
250
251
*
251
252
* @param backlog Number of pending connections that can be queued
252
253
* simultaneously, defaults to 1
253
- * @return 0 on success, negative error code on failure
254
+ * @return NSAPI_ERROR_OK on success, negative error code on failure
254
255
*/
255
256
virtual nsapi_error_t listen (int backlog = 1 ) = 0;
256
257
};
0 commit comments