[REBOL] Re: UDP Multicast to TCP
From: lmeyer:bltech:za at: 18-Nov-2009 9:18
Hi Graham
Yes, I believe you are right.
So I went and created a TCP Server port code as per the cookbook example:
REBOL[Title: "Port 4550"]
mon-address: read make url! join "dns://" (read dns://)
inputmulticast: open udp://:6550
set-modes inputmulticast [multicast-groups: copy compose/deep [[239.2.0.81
(mon-address)]] ]
listen: open/direct/no-wait tcp://:4550
waitports: [listen]
forever [
data: wait waitports
print "client connected"
either same? data listen [
active-port: first listen
append waitports active-port
][
insert data copy inputmulticast
]
]
There are 2 problems with this script for me:
1. Only the first tcp connection still receives the data. Subsequent
connections can access the port, but does not receive any data
2. I have to press any key (like spacebar) for the first connection to
receive data. I believe it is the "wait waitports" statement that creates
this scenario, but without it the code does not work at all.
It seems like the "insert data copy inputmulticast" is preventing any
subsequent connections from getting the data. The reason I say this is
because I only see the "client connected" message after the first
connection. For any subsequent connections the "client connected" never
appears although the clients are connected using telnet to port tcp 4550.
I am really stuck here. Do you know of anyone to assist me with this as we
would even consider paying a fee to get this sorted out?
Thank you
Leon