Skip to content

Commit

Permalink
Fix for UDP server failing to start on Linux VM
Browse files Browse the repository at this point in the history
  • Loading branch information
shalinnijel2 committed Jan 11, 2023
1 parent 5d86090 commit 89b731d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,13 @@ The primary dependencies to install the project are the following:
> - Linux
>
> - MacOS is not fully supported -- see "IPv6 Warning" below
> - Other non-Linux operating systems are not supported
> - Other non-Linux operating systems are not supported*
>
> - Poetry [^3]
> - Python >= 3.9
<sub>*If using a Windows machine, follow the same steps as below on a Linux VM.</sub>

There are two recommended ways of running the project:

### Running with Docker
Expand Down
4 changes: 4 additions & 0 deletions iso15118/secc/transport/udp_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,10 @@ async def __init__.
full_ipv6_address = await get_link_local_full_addr(SDP_SERVER_PORT, iface)
sock.bind(full_ipv6_address)
else:
# Required if running on a Linux VM on Windows
if not hasattr(socket, "SO_BINDTODEVICE"):
socket.SO_BINDTODEVICE = 25

sock.setsockopt(
socket.SOL_SOCKET,
socket.SO_BINDTODEVICE,
Expand Down

0 comments on commit 89b731d

Please sign in to comment.