Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix for UDP server failing to start on Linux VM #187

Merged
merged 1 commit into from
Jan 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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