>>>>> Carsten Zerbst writes:
Carsten> I have some problem with multicast. If I open sockets on
Carsten> different groups and sockets and send with multicast to them,
Carsten> the results look more like a broadcast. Disregarding the
Carsten> group, all client socket with the same port get the
Carsten> packages. That is not the behaviour I expected. Did I
Carsten> something wrong or haven't I understand the multicast
Carsten> functionality ?
I do not understand where the problem is. Your server sends 4
multicasts to all the four different multicast transport addresses. So
you get four bindings evaluated - each binding for a different udp
socket handle. The only problem I can see is that the output of udp
info is not very useful in this case...
Here is a revised version of your example. (Note that the client does
not even have to use a multicast UDP socket if he just specifies a
multicast address as the destination.)
client:
set u [udp open]
udp send $u 224.1.0.0 5678 "foobar"
udp send $u 224.1.0.0 5679 "barfoo"
server:
proc getit {u} {
puts "$u: got [udp receive $u] ([udp info $u])"
}
lappend l [udp multicast open 224.1.0.0 5678]
lappend l [udp multicast open 224.1.1.0 5678]
lappend l [udp multicast open 224.1.0.0 5679]
lappend l [udp multicast open 224.1.1.0 5679]
foreach u $l {
udp bind $u readable [list getit $u]
}
vwait forever
The output I get in this case on the server side is:
udp1: got 134.169.34.191 52111 foobar (0.0.0.0 5678 0.0.0.0 0)
udp3: got 134.169.34.191 52111 barfoo (0.0.0.0 5679 0.0.0.0 0)
I think this is just working fine.
/js
-- Juergen Schoenwaelder Technical University Braunschweig <schoenw@ibr.cs.tu-bs.de> Dept. Operating Systems & Computer Networks Phone: +49 531 391 3289 Bueltenweg 74/75, 38106 Braunschweig, Germany Fax: +49 531 391 5936 <URL:http://www.ibr.cs.tu-bs.de/~schoenw/>-- !! This message is brought to you via the `tkined & scotty' mailing list. !! Please do not reply to this message to unsubscribe. To subscribe or !! unsubscribe, send a mail message to <tkined-request@ibr.cs.tu-bs.de>. !! See http://wwwsnmp.cs.utwente.nl/~schoenw/scotty/ for more information.
This archive was generated by hypermail 2b29 : Mon Jan 08 2001 - 15:27:48 MET