Problem with socket communication from docker container to the host and not the otherway around

I am having some trouble with socket communication. The problem arises when the Linux container is the server and the windows host is the client. However, swapping the role works i.e. windows host is the server and the Linux container is the client.

I am running an Ubuntu container from Windows Docker Desktop, with the following cmd:
docker run -dit --expose 9090 -p 9090:9090/udp ubuntu:latest .
And running a simple server python script:

Server side:

import socket

def Main():

host = '172.17.0.2' #linux ip
port = 9090

s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
s.bind((host, port))

print("Server Started")
while True:
    data, addr = s.recvfrom(1024)
    data = data.decode('utf-8')
    print("Message from: " + str(addr))
    print("From connected user: " + data)
    data = data.upper()
    print("Sending: " + data)
    s.sendto(data.encode('utf-8'), addr)
c.close()

if __name__=='__main__':
    Main()

Client side:

import socket

def Main():

    host='172.31.16.1' #windows ip (WSL adr)
    port = 9090
    
    server = ('172.17.0.2', 9090)
    
    s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
    s.bind((host,port))
    
    message = input("-> ")
    while message !='q':
        s.sendto(message.encode('utf-8'), server)
        data, addr = s.recvfrom(1024)
        data = data.decode('utf-8')
        print("Received from server: " + data)
        message = input("-> ")
    s.close()

if __name__=='__main__':
    Main()

When I run this i get :
OSError: [WinError 10051] A socket operation was attempted to an unreachable network
when my client call: s.sendto(message.encode('utf-8'), server)

any idea why this is happening?