diff --git a/src/unix/udp.c b/src/unix/udp.c index aad7a6dc..d9c15e4e 100644 --- a/src/unix/udp.c +++ b/src/unix/udp.c @@ -704,7 +704,15 @@ int uv__udp_disconnect(uv_udp_t* handle) { do { errno = 0; +#ifdef __PASE__ + // On IBMi a connectionless transport socket can be disconnected by + // either setting the addr parameter to NULL or setting the + // addr_length parameter to zero, and issuing another connect(). + // https://www.ibm.com/docs/en/i/7.4?topic=ssw_ibm_i_74/apis/connec.htm + r = connect(handle->io_watcher.fd, (struct sockaddr*) NULL, 0); +#else r = connect(handle->io_watcher.fd, (struct sockaddr*) &addr, sizeof(addr)); +#endif } while (r == -1 && errno == EINTR); if (r == -1) { diff --git a/test/test-udp-connect.c b/test/test-udp-connect.c index cd159b68..0be702ef 100644 --- a/test/test-udp-connect.c +++ b/test/test-udp-connect.c @@ -98,10 +98,6 @@ static void sv_recv_cb(uv_udp_t* handle, TEST_IMPL(udp_connect) { -#if defined(__PASE__) - RETURN_SKIP( - "IBMi PASE's UDP connection can not be disconnected with AF_UNSPEC."); -#endif uv_udp_send_t req; struct sockaddr_in ext_addr; struct sockaddr_in tmp_addr; diff --git a/test/test-udp-connect6.c b/test/test-udp-connect6.c index 8e385af9..d000daf1 100644 --- a/test/test-udp-connect6.c +++ b/test/test-udp-connect6.c @@ -98,10 +98,6 @@ static void sv_recv_cb(uv_udp_t* handle, TEST_IMPL(udp_connect6) { -#if defined(__PASE__) - RETURN_SKIP( - "IBMi PASE's UDP connection can not be disconnected with AF_UNSPEC."); -#endif uv_udp_send_t req; struct sockaddr_in6 ext_addr; struct sockaddr_in6 tmp_addr;