[REBOL] Re: UDP Multicast to TCP
From: lmeyer:bltech:za at: 18-Nov-2009 10:32
Hi David
I have actually used Alfred Began's multicast example to build our code. It
works well.
We are receiving a TCP stream from an application server, converting it to
UDP Multicast using rebcore, sending it one-way via satellite to multiple
receive sites. At the receive sites we are listening for the multicast using
rebcore and converting back to TCP Multicast. The whole chain works 100%
except for the multiple connections to the TCP port on the client side. We
are fooling the 3rd party client application in thinking it is receicing the
TCP stream directly from the 3rd party server.
If anyone is interested, here is the code for the server side converting the
incoming TCP stream to UDP Multicast:
REBOL[Title: "Port 4550"]
system/schemes/default/timeout: 72:00
listen: open/no-wait tcp://:4550
waitports: [listen]
odata: open udp://239.2.0.81:6550 ; udp broadcast port
set-modes odata [multicast-ttl: 10]
set-modes odata [multicast-interface: 192.168.20.23]
forever [
port: wait waitports
either same? port listen [
active-port: first listen
append waitports active-port
] [
incoming-from-remote: copy port
either incoming-from-remote [
insert odata incoming-from-remote
;print incoming-from-remote
] [
remove find waitports port
close port
]
]
]