Skip to content

Commit 3418992

Browse files
authored
Merge pull request #9251 from jepler/fix-udp-raw-socket-connect
set the connected status of a socket after UDP & raw connect
2 parents 1382006 + 8acfc0c commit 3418992

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
@@ -994,11 +994,17 @@ void common_hal_socketpool_socket_connect(socketpool_socket_obj_t *socket,
994994
}
995995
case MOD_NETWORK_SOCK_DGRAM: {
996996
err = udp_connect(socket->pcb.udp, &dest, port);
997+
if (err == ERR_OK) {
998+
socket->state = STATE_CONNECTED;
999+
}
9971000
break;
9981001
}
9991002
#if MICROPY_PY_LWIP_SOCK_RAW
10001003
case MOD_NETWORK_SOCK_RAW: {
10011004
err = raw_connect(socket->pcb.raw, &dest);
1005+
if (err == ERR_OK) {
1006+
socket->state = STATE_CONNECTED;
1007+
}
10021008
break;
10031009
}
10041010
#endif

0 commit comments

Comments
 (0)