Example #1
0
    from UDPConnection import UDPConnection
    from TCPConnection import TCPConnection
    from AudioServer import AudioSocketServer

    HOST = socket.gethostbyname(socket.gethostname())
    PORT = 50007
    LISTEN_ALL_HOST = '0.0.0.0'

    app = QtWidgets.QApplication(sys.argv)
    application = MainWindow()
    application.show()

    UDP_socket = UDPConnection(HOST, PORT)
    UDP_socket.setsockopt_reuseaddr()
    UDP_socket.bind(LISTEN_ALL_HOST, PORT)
    UDP_socket.send_address_to_sender()
    UDP_socket.start_UDP_receiving()

    TCP_socket = TCPConnection(application.signal.new_mes)
    TCP_socket.setsockopt_reuseaddr()
    TCP_socket.bind(HOST, PORT)
    TCP_socket.listen(10)
    TCP_socket.set_server_socket()

    application.set_socket(TCP_socket)
    application.start_threading()

    audio_socket = AudioSocketServer(HOST, PORT + 1)

    sys.exit(app.exec())