0

I am trying to use my Windows 11 laptop as a external display of my Windows 11 work computer.

The Wireless display built in function seems promising.

So far, no success. All installed, and tested on Wifi, and Android-Hotspot, so I wonder if there is connectivity.

I am trying to test the following code:

MCAST_GRP = '224.1.1.1'
MCAST_PORT = 5007
MESSAGE = "Hello, multicast!"
sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM, socket.IPPROTO_UDP)
sock.setsockopt(socket.IPPROTO_IP, socket.IP_MULTICAST_TTL, 32)
sock.sendto(MESSAGE.encode('utf-8'), (MCAST_GRP, MCAST_PORT))

and

import socket
import struct
MCAST_GRP = '224.1.1.1'
MCAST_PORT = 5007
sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM, socket.IPPROTO_UDP)
sock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
sock.bind(('', MCAST_PORT))
mreq = struct.pack("4sl", socket.inet_aton(MCAST_GRP), socket.INADDR_ANY)
sock.setsockopt(socket.IPPROTO_IP, socket.IP_ADD_MEMBERSHIP, mreq)
while True:
   data, addr = sock.recvfrom(1024)
   print(f"Received message from {addr}: {data.decode('utf-8')}")

One running in the receiving computer, the other executed in the other computer, and no communication.

Questions:

  • Should I configure the MCAST_GRP to my local router configuration? mine is on 192.168.0.X with 23 and 35 for each computer, and 200 for the router.

  • Should I ask router provider to open ports?

Note: if I change IP to anything on my range, the following message appears:

OSError: [WinError 10049] The requested address is not valid in its context

0

You must log in to answer this question.