summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
-rw-r--r--extmod/modusocket.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/extmod/modusocket.c b/extmod/modusocket.c
index 5f07d4f789..9b1eb8cd7a 100644
--- a/extmod/modusocket.c
+++ b/extmod/modusocket.c
@@ -451,7 +451,8 @@ mp_uint_t socket_ioctl(mp_obj_t self_in, mp_uint_t request, uintptr_t arg, int *
}
if (self->nic == MP_OBJ_NULL) {
if (request == MP_STREAM_POLL) {
- return MP_STREAM_POLL_NVAL;
+ // New sockets are writable and not connected.
+ return MP_STREAM_POLL_HUP | MP_STREAM_POLL_WR;
}
*errcode = MP_EINVAL;
return MP_STREAM_ERROR;