UDP stops working on Ventura

Hello,


Recently I found the UDP function with Python stops working any more over wired ethernet cable, and I verified the same code on Windows, it's still working fine. What I can confirm is it was working well before I upgraded my MacBook Pro M1 version to Ventura. I also double checked the firewall is already turned off when the issue happens.


Could you please take a look at this issue and give me some suggestion?


Thanks!

MacBook Pro Apple Silicon

Posted on Dec 15, 2022 10:10 AM

Reply

Similar questions

2 replies

Dec 17, 2022 1:57 PM in response to stanley_lei

Are you using the built-in Python3 in macOS Ventura located in /usr/bin? Is your Python code compatible with the Ventura Python 3.9.6? Have you granted Terminal access to Full Disk Access? How about your Python App?


Python 2.x has been depreciated by Python Developers and is being removed from many systems including Linux. If you install a newer Python3 with Homebrew you'll have version 3.10.8. There are tools via Homebrew to manage multiple versions of Python for different projects, etc.





Dec 17, 2022 2:24 PM in response to James Brickley

Hi James,


Thanks for your reply. I'm using the python3.10.8 installed with brew, it's on /opt/homebrew/bin/python3. The python code is very simple like below:


import socket
import logging

HOST_ADDRESS   = "192.168.10.11"
UDP_LOG_RX_PORT = 20000

logging.basicConfig(
    format='%(asctime)s %(message)s',
    level=logging.DEBUG,
    datefmt='%Y-%m-%d %H:%M:%S |'
)


def start_receiver():
    logging.debug(f'START: {HOST_ADDRESS}:{UDP_LOG_RX_PORT}')
    _socket = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
    _socket.bind((HOST_ADDRESS, UDP_LOG_RX_PORT))

    while True:
        data, _ = _socket.recvfrom(1024)
        logging.debug(f'{data.decode()}')

if __name__ == "__main__":
    start_receiver()


It's used to receive the logs and print out on the terminal. It was working before I upgraded OS to Ventura. To confirm this issue, I also ran the wireshark to sniffer the ethernet traffic, I can see all the UDP logs from wireshark.


This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

UDP stops working on Ventura

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.