1

I have the following problem: I have a UDP server on one computer (Ubuntu 16.04) and a client on another computer (Windows 10). If I send messages from Windows to Ubuntu, it won't listen. If I send messages from Ubuntu to Windows, it will hear normally. I need the Ubuntu pc to listen to messages sent from Windows or my smartphone that is on the same network, can someone help me? My project depends on an application on my smartphone sending UDP messages to my computer (Ubuntu 16.04)

I'm using python-osc 1.7.4

This is my code:

Server:

from pythonosc import dispatcher
from pythonosc import osc_server


if __name__ == "__main__":
  ip = '192.168.0.11'
  port = 5005

  dispatcher = dispatcher.Dispatcher()
  dispatcher.map("test", print)

  server = osc_server.ThreadingOSCUDPServer((ip, port), dispatcher)
  print("Serving on {}".format(server.server_address))
  server.serve_forever()

Client:

import random
import time

from pythonosc import udp_client
My Ubuntu pc has UDP ports closed, how do I open it?
I already disabled the firewall and tried to open the ports with iptables but nothing has changed.

if __name__ == "__main__":
  ip = '192.168.0.11'
  port =5005
  client = udp_client.SimpleUDPClient(ip, port)
  for x in range(20):
    client.send_message("/test", random.random())
    time.sleep(1)

0 Answers0