File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed
can/interfaces/udp_multicast Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change 11import errno
22import logging
3+ import platform
34import select
45import socket
56import struct
67import time
78import warnings
8- import platform
99from typing import List , Optional , Tuple , Union
1010
1111import can
2222 ioctl_supported = False
2323 pass
2424
25- # All ioctls aren't supported on MacOS.
25+ # All ioctls aren't supported on MacOS.
2626is_macos = platform .system () == "Darwin"
2727
2828log = logging .getLogger (__name__ )
@@ -277,7 +277,10 @@ def _create_socket(self, address_family: socket.AddressFamily) -> socket.socket:
277277
278278 # Allow multiple programs to access that address + port
279279 sock .setsockopt (socket .SOL_SOCKET , socket .SO_REUSEADDR , 1 )
280- sock .setsockopt (socket .SOL_SOCKET , socket .SO_REUSEPORT , 1 )
280+
281+ # Option not supported on Windows.
282+ if hasattr (socket , "SO_REUSEPORT" ):
283+ sock .setsockopt (socket .SOL_SOCKET , socket .SO_REUSEPORT , 1 )
281284
282285 # set how to receive timestamps
283286 try :
You can’t perform that action at this time.
0 commit comments