Vai al contenuto


Foto

Multicast


Questa discussione e' stata archiviata Questo significa che non e' possibile rispondere
65 risposte a questa discussione

#41 MadJackal

MadJackal

    Schiavo

  • Membri
  • StellettaStellettaStellettaStellettaStelletta
  • 3.105 Messaggi:

Inviato 22 giugno 2011 - 09:41

Ma quello che non capisco è perché non posso fare un join multicast address su una porta diversa. Cioè, posso usare UNA sola porta ???


Mi pare che anche il multicast (UDP) necessiti di una dest port, o sbaglio? :sisi:
Non prendermi sul serio, dovrei recuperare il manuale di reti e darci un occhio, ma ora sono in ufficio :patpat:
In Soviet Italy, the evil army owns you!

#42 trallallero

trallallero

    Schiavo

  • Membri
  • StellettaStellettaStellettaStellettaStellettaStellettaStelletta
  • 16.188 Messaggi:

Inviato 22 giugno 2011 - 09:47

[quote name="MadJackal ?":2e9gxauk] [quote name='"trallallero ?":2e9gxauk]Ma quello che non capisco è perché non posso fare un join multicast address su una porta diversa. Cioè' date=' posso usare UNA sola porta ???[/quote']

Mi pare che anche il multicast (UDP) necessiti di una dest port, o sbaglio? :cereal:
Non prendermi sul serio, dovrei recuperare il manuale di reti e darci un occhio, ma ora sono in ufficio :patpat:[/quote]
Allora, ho compilato il boost sender
http://www.boost.org... ... sender.cpp
e il boost receiver
http://www.boost.org... ... ceiver.cpp

Poi ho lanciato 2 clients e un server e funziona tutto like a charm!

Ora mi preparo ad entrare nel code dei boost guys, se non mi vedete nelle prossime 4-5 ore, venitemi cercare in qualche header file :sisi:
Don't worry, faith will come soon, like a recall but,
if you can't wait, just stop thinking at all 

 


#43 trallallero

trallallero

    Schiavo

  • Membri
  • StellettaStellettaStellettaStellettaStellettaStellettaStelletta
  • 16.188 Messaggi:

Inviato 22 giugno 2011 - 09:48

Quello che ho notato è che solo i clients fanno la bind, non il sender.
Don't worry, faith will come soon, like a recall but,
if you can't wait, just stop thinking at all 

 


#44 MadJackal

MadJackal

    Schiavo

  • Membri
  • StellettaStellettaStellettaStellettaStelletta
  • 3.105 Messaggi:

Inviato 22 giugno 2011 - 09:52

Eppure qui http://www.boost.org... ... ceiver.cpp vedo:

socket_.set_option(boost::asio::ip::udp::socket::reuse_address(true));


Perchè non sono un esperto di multicast. Mi dicono dalla scrivania dietro la mia che in multicast il kernel dovrebbe consegnare il messaggio a tutti i processi in ascolto. Però devi mettere il setsockopt() con il SO_REUSEADDR prima della bind().

Se non ti funziona è perchè ricordo bene e SO_REUSADDR sotto linux è broken.
In Soviet Italy, the evil army owns you!

#45 trallallero

trallallero

    Schiavo

  • Membri
  • StellettaStellettaStellettaStellettaStellettaStellettaStelletta
  • 16.188 Messaggi:

Inviato 22 giugno 2011 - 09:55

Ieri ho visto che SO_REUSEPORT è deprecated su Linux, non SO_REUSEADDR.

Però vedo che i boost guys usano anche SO_BROADCAST.
Don't worry, faith will come soon, like a recall but,
if you can't wait, just stop thinking at all 

 


#46 MadJackal

MadJackal

    Schiavo

  • Membri
  • StellettaStellettaStellettaStellettaStelletta
  • 3.105 Messaggi:

Inviato 22 giugno 2011 - 10:02

Ieri ho visto che SO_REUSEPORT è deprecated su Linux, non SO_REUSEADDR.


MI confondo sempre tra *BSD e linux, troppo abituato ad usare il primo.
Quelli di Linux hanno deprecato SO_REUSEPORT perchè era solo un modo di girare intorno ad alcune limitazioni di SO_REUSEADDR, che ora sotto linux non ci sono più.
In Soviet Italy, the evil army owns you!

#47 trallallero

trallallero

    Schiavo

  • Membri
  • StellettaStellettaStellettaStellettaStellettaStellettaStelletta
  • 16.188 Messaggi:

Inviato 22 giugno 2011 - 10:04

[quote name="MadJackal ?":16xz6wwe] [quote name='"trallallero ?":16xz6wwe] Ieri ho visto che SO_REUSEPORT è deprecated su Linux' date=' non SO_REUSEADDR.[/quote']

MI confondo sempre tra *BSD e linux, troppo abituato ad usare il primo.
Quelli di Linux hanno deprecato SO_REUSEPORT perchè era solo un modo di girare intorno ad alcune limitazioni di SO_REUSEADDR, che ora sotto linux non ci sono più.[/quote]
Ah ecco.

Comunque non ne vengo fuori... devo solo controllare questa manciata di files :patpat:

#include

#include

#include

#include

#include

#include

#include

#include

#include

#include

#include

#include

#include

#include

#include

#include

#include

#include

#include

#include

#include

#include

#include

#include

#include

#include

#include

#include

#include

#include

#include

#include

#include

#include

#include

#include

#include

#include

#include

#include

#include

#include

#include

#include

#include

#include

#include

#include

#include

#include

#include

#include

#include

#include

#include

#include

#include

#include

#include

#include

#include

#include

#include

#include

#include

#include

#include

#include

#include

#include

#include

#include

#include

#include

#include

#include

#include

#include

#include
Don't worry, faith will come soon, like a recall but,
if you can't wait, just stop thinking at all 

 


#48 MadJackal

MadJackal

    Schiavo

  • Membri
  • StellettaStellettaStellettaStellettaStelletta
  • 3.105 Messaggi:

Inviato 22 giugno 2011 - 10:04

Prova ad usare SO_REUSEADDR e SO_BROADCAST.
Già fatto sto test?
In Soviet Italy, the evil army owns you!

#49 trallallero

trallallero

    Schiavo

  • Membri
  • StellettaStellettaStellettaStellettaStellettaStellettaStelletta
  • 16.188 Messaggi:

Inviato 22 giugno 2011 - 10:13

Prova ad usare SO_REUSEADDR e SO_BROADCAST.
Già fatto sto test?

No, ma mi sa che mi sono confuso su sto SO_BROADCAST, non so se veramente lo usano sti stronzi.

In pratica devo capire cosa fanno qui:

boost::asio::ip::udp::endpoint listen_endpoint(listen_address, multicast_port);

socket_.open(listen_endpoint.protocol());

socket_.set_option(boost::asio::ip::udp::socket::reuse_address(true));

socket_.bind(listen_endpoint);



// Join the multicast group.

socket_.set_option(boost::asio::ip::multicast::join_group(multicast_address));




Don't worry, faith will come soon, like a recall but,
if you can't wait, just stop thinking at all 

 


#50 MadJackal

MadJackal

    Schiavo

  • Membri
  • StellettaStellettaStellettaStellettaStelletta
  • 3.105 Messaggi:

Inviato 22 giugno 2011 - 10:39

http://linux.die.net/man/7/ip

Datagrams to broadcast addresses can be only sent or received when the SO_BROADCAST socket flag is set. In the current implementation connection oriented sockets are only allowed to use unicast addresses.


A me sa proprio che lo usano, almeno stando a man 7 ip :patpat:
In Soviet Italy, the evil army owns you!

#51 trallallero

trallallero

    Schiavo

  • Membri
  • StellettaStellettaStellettaStellettaStellettaStellettaStelletta
  • 16.188 Messaggi:

Inviato 22 giugno 2011 - 10:45

http://linux.die.net/man/7/ip

Datagrams to broadcast addresses can be only sent or received when the SO_BROADCAST socket flag is set. In the current implementation connection oriented sockets are only allowed to use unicast addresses.


A me sa proprio che lo usano, almeno stando a man 7 ip :sisi:

Si ma broadcast <> multicast.


Comunque ora ci si mette anche Abbraccianigga OS, diolinux :patpat:

./jackd -d alsa -r48000 -p1024 -S -n3
the playback device "hw:0" is already in use. Please stop the application using it and run JACK again


NON C'È NIENTE CHE USA LA hw:0! HO KILLATO TUTTO :cereal:
Don't worry, faith will come soon, like a recall but,
if you can't wait, just stop thinking at all 

 


#52 trallallero

trallallero

    Schiavo

  • Membri
  • StellettaStellettaStellettaStellettaStellettaStellettaStelletta
  • 16.188 Messaggi:

Inviato 22 giugno 2011 - 10:47

Era virtual box :patpat:
Don't worry, faith will come soon, like a recall but,
if you can't wait, just stop thinking at all 

 


#53 MadJackal

MadJackal

    Schiavo

  • Membri
  • StellettaStellettaStellettaStellettaStelletta
  • 3.105 Messaggi:

Inviato 22 giugno 2011 - 10:56

Si ma broadcast <> multicast.


My fault, sto fondendo a causa di file system che esplodono e alert che suonano come battone. :patpat:
E quelle puttane degli sviluppatori chiedono pure i log! :sisi:
In Soviet Italy, the evil army owns you!

#54 trallallero

trallallero

    Schiavo

  • Membri
  • StellettaStellettaStellettaStellettaStellettaStellettaStelletta
  • 16.188 Messaggi:

Inviato 22 giugno 2011 - 12:28

Ok, funge.

Praticamente era il SO_REUSECOSO ma non avevo pensato che, usando il mio RTP plugin, se ne aprono 2 di socket (rtp e rtcp) e l'option va messa ad entrambi.

Grazie MadJackal

Thanks boost :patpat:
Don't worry, faith will come soon, like a recall but,
if you can't wait, just stop thinking at all 

 


#55 MadJackal

MadJackal

    Schiavo

  • Membri
  • StellettaStellettaStellettaStellettaStelletta
  • 3.105 Messaggi:

Inviato 22 giugno 2011 - 12:53


Grazie MadJackal


Ecco, ringrazia boost, che io ho failato su tutta la linea confondendo TCP ed UDP :patpat:
In Soviet Italy, the evil army owns you!

#56 trallallero

trallallero

    Schiavo

  • Membri
  • StellettaStellettaStellettaStellettaStellettaStellettaStelletta
  • 16.188 Messaggi:

Inviato 22 giugno 2011 - 13:01

?[/url]":1sd1buhe]
Grazie MadJackal


Ecco, ringrazia boost, che io ho failato su tutta la linea confondendo TCP ed UDP :sisi:

Vabbè ma sei stato utile lo stesso. Hai presente il "debug confessionale" ? :patpat:
Don't worry, faith will come soon, like a recall but,
if you can't wait, just stop thinking at all 

 


#57 trallallero

trallallero

    Schiavo

  • Membri
  • StellettaStellettaStellettaStellettaStellettaStellettaStelletta
  • 16.188 Messaggi:

Inviato 22 giugno 2011 - 13:05

La cosa più bella è che emailando con Jori (autore delle jrtplib) alla fine avevo ragione io :patpat:
Lui continuava a dire che la sua libreria non aveva bug, che non potevo aprire più applicazioni per colpa del SO, invece...
Don't worry, faith will come soon, like a recall but,
if you can't wait, just stop thinking at all 

 


#58 MadJackal

MadJackal

    Schiavo

  • Membri
  • StellettaStellettaStellettaStellettaStelletta
  • 3.105 Messaggi:

Inviato 22 giugno 2011 - 14:21

La cosa più bella è che emailando con Jori (autore delle jrtplib) alla fine avevo ragione io :cereal:
Lui continuava a dire che la sua libreria non aveva bug, che non potevo aprire più applicazioni per colpa del SO, invece...


Il tuo scenario è troppo raro, se usi un socket TCP/UDP unicast ha ragione lui. :sisi:
Il problema è il multicast, che fa così cagare che non usa nessuno.

:patpat:
In Soviet Italy, the evil army owns you!

#59 trallallero

trallallero

    Schiavo

  • Membri
  • StellettaStellettaStellettaStellettaStellettaStellettaStelletta
  • 16.188 Messaggi:

Inviato 22 giugno 2011 - 14:56

?[/url]":34huww1t] La cosa più bella è che emailando con Jori (autore delle jrtplib) alla fine avevo ragione io :sbav:
Lui continuava a dire che la sua libreria non aveva bug, che non potevo aprire più applicazioni per colpa del SO, invece...


Il tuo scenario è troppo raro, se usi un socket TCP/UDP unicast ha ragione lui. :cereal:
Il problema è il multicast, che fa così cagare che non usa nessuno.

:patpat:

Il mio plugin usa la sua libreria rtp/multicast.

Niente, oggi non ne azzecchi una :sisi:
Don't worry, faith will come soon, like a recall but,
if you can't wait, just stop thinking at all 

 


#60 MadJackal

MadJackal

    Schiavo

  • Membri
  • StellettaStellettaStellettaStellettaStelletta
  • 3.105 Messaggi:

Inviato 22 giugno 2011 - 16:35

Il mio plugin usa la sua libreria rtp/multicast.
Niente, oggi non ne azzecchi una :biggrin:


:trollface: :awesome: :lol: :lol:
In Soviet Italy, the evil army owns you!