UDP Multicast not working

Started by pjot, August 31, 2004, 03:47:55 AM

Previous topic - Next topic

pjot

#15
I saw the new 8.1.5, thanx! I will test the multicast this weekend.



Again good luck surviving the hurricane. It's on the daily news in The Netherlands as well.

newdep

#16
Hello Lutz,



I did not see the 8.1.5 release befor so my last reply was a bit in advance.



Using MultiCast-groups is impossible right now :-)



As (net-listen 4096 "226.0.0.1" "multi") can only listen on 1 group,

A 'list can be the solution here to replace the ip-string.



i.e. multicast-groups looks like:

(net-listen 4096 ( "226.0.0.1" "230.1.1.20" "233.33.33.10") "multi")



Perhpas you have a trick for net-listen ? A net-select wont do the trick...



Regards, Norman.
-- (define? (Cornflakes))

pjot

#17
Well, this can be solved of course by listening multiple times:



(net-listen 4096 "226.0.0.1" "multi") => 5

(net-listen 4096 "230.1.1.20" "multi") => 6

(net-listen 4096 "233.33.33.10" "multi") => 7



...so for every IP address a different socketnumber is returned.



That means that every socketnumber points to a group.



In your newLisp program you create an array holding all socketnumbers, and with a loop you send the same message to all groups.

newdep

#18
hiya Pjot,



Does that work ???????



i.e.

Nice suggestion though a multicast-group listenes all together on 1 port

or more groups on more ports ...



Newlisp net-listen binds already to a port...the rest will return 'nil

(its not default to bind again on a binded port ;-)



Norman.
-- (define? (Cornflakes))

pjot

#19
I am changing my UDP chat code, as soon as I have the results I let you know.

pjot

#20
Report so far: preliminary tests show correct behaviour of the UDP functionality.



And what does this mean:


QuoteNewlisp net-listen binds already to a port...the rest will return 'nil

(its not default to bind again on a binded port ;-)


The net-listen command binds to an ipaddress/port combination. New net-listen commands will only return NIL if you try to net-listen to the same ipaddress/port combination again.

newdep

#21
Hello Pjot,



Yes that is correct, thus Multicast-groups wont work.



Regards, Norman.
-- (define? (Cornflakes))

pjot

#22
It depends on what you mean with multicast GROUPS. A class D address already is  a group. This happens when multiple users listen to that same class D address. So for example 224.1.1.1 already is a multicast group. Setting up a socket to such an IP address defines a multicast group.



But 1 socket by it's very nature cannot listen to different class D IP address and ports at the same time.



So for every individual class D IP address you have to setup a new socket. This can be realized the way described earlier.



Obviously you mean multiple multicast groups? Reaching this with 1 socket?

Lutz

#23
I seems when using 'C' setsockopt(..  IP_ADD_MEMBERSHIP ...) several calls with different multicast group IPs could be isssued on the same socket, but I am not planning to implement groups of multicast groups.



Peter's suggestion to use several net-listen on the same port but with different multicast IPs, seems to be a good solution for this scenario.



Lutz

newdep

#24
Hi Lutz,



I dont understand your advice? Does that meen that newlisp is capable of

binding to the same port with different multicast adresses with a net-listen?

I think i need to reread the manual if that is the case.. ;-)



Regards, Norman.
-- (define? (Cornflakes))

Lutz

#25
>>> pjot on Sept 3 >>>

(net-listen 4096 "226.0.0.1" "multi") => 5

(net-listen 4096 "230.1.1.20" "multi") => 6

(net-listen 4096 "233.33.33.10" "multi") => 7

>>>



This seems to work, but why would you do such a thing? several clients can talk to a server listening on one multicast address and several servers could listen on the same one multicast address already.



Lutz

newdep

#26
Ha.. i was testing on 8.1.4 ;-) ...funny ;-)



Good that it works, because the concept/power of multicast lies in multicast-groups. where every group is multiple addresses.



Regards, Norman.
-- (define? (Cornflakes))

pjot

#27
Hi Lutz,



More tests today with multicasting showed very good results (WinXP, Win2000). My tests between Slackware and Mandrake also were successfull.



Thank you for your good work!



Regards



Peter

pjot

#28
Hi all,



I have extended the newLisp UDP chat with multicast features. Screenshots of the new version can be found at:



http://www.gtk-server.org/apps.html">http://www.gtk-server.org/apps.html



-----------------------------------



Features:

- Uses extended formatting features of text_view

- Able to have UDP or MultiCast communication

- Notification if frame is lost (UDP mode)

- Communication with GTK-server is UDP also

- Fixed bug with encryption string

- Fixed bug with inserting text

- Fixed bug with getting time on Linux

- Fixed bug with sending empty strings



-----------------------------------



Enjoy!



Peter

Lutz

#29
Thanks Peter, how do you like the fact that newLISP now has threads using 'fork' in newlisp-8.1.7 (development directory) ? Give it a try. There are examples in the documentation.



Lutz



ps: newlisp-8.1.8 wll also have 'waitpid'