Skip to content

Commit 8acfc0c

Browse files
committed
set the connected status of a socket after UDP & raw connect
1 parent 781c577 commit 8acfc0c

File tree

1 file changed

+6
-0
lines changed
  • ports/raspberrypi/common-hal/socketpool

1 file changed

+6
-0
lines changed

ports/raspberrypi/common-hal/socketpool/Socket.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1014,11 +1014,17 @@ void common_hal_socketpool_socket_connect(socketpool_socket_obj_t *socket,
10141014
}
10151015
case MOD_NETWORK_SOCK_DGRAM: {
10161016
err = udp_connect(socket->pcb.udp, &dest, port);
1017+
if (err == ERR_OK) {
1018+
socket->state = STATE_CONNECTED;
1019+
}
10171020
break;
10181021
}
10191022
#if MICROPY_PY_LWIP_SOCK_RAW
10201023
case MOD_NETWORK_SOCK_RAW: {
10211024
err = raw_connect(socket->pcb.raw, &dest);
1025+
if (err == ERR_OK) {
1026+
socket->state = STATE_CONNECTED;
1027+
}
10221028
break;
10231029
}
10241030
#endif

0 commit comments

Comments
 (0)