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
]
]
]
-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of
david may
Sent: Wednesday, November 18, 2009 9:38 AM
Hello Leon,
Wednesday, November 18, 2009, 4:05:26 AM, you wrote:
> Hi
>
> This is my first post. I only discovered Rebol a couple of days ago,
> and wow, I love it!
>
> I need some help though with something that I am sure of is very
> basic, but I have been struggling to get it right.
>
> I am converting an incoming UDP stream to TCP. The TCP is forwarded to
> anyone that connects to the TCP port. It works perfectly for our
> application on the local PC.
>
> Here is the code:
>
> REBOL [ Title: "Multicast Receiver"]
>
> mon-address: read make url! join "dns://" (read dns://)
> inputmulticast: open udp://:6554
> set-modes inputmulticast [multicast-groups: copy compose/deep
> [[239.2.0.81 (mon-address)]] ]
>
> tcpoutput: open/direct/no-wait tcp://:4554
>
> forever [
> tcp: first tcpoutput
> until [ error? try [
> receive: wait inputmulticast
> insert tcp copy receive
> ]
> ]
> close tcp
> ]
> The problem is that it does not work with multiple incoming requests,
> only with one. The other tcp ports are able to connect, but they do
> not receive any data. Only the first client session receives the data.
> I do not need to wait for an input from the client to start forwarding
> the data, hence the absence of the "wait tcp".
>
> I use multiple telnet sessions to the open TCP port.
>
> I have tried to create a server as described in
> http://www.rebol.net/cookbook/recipes/0034.html but I cannot get it to
work.
> This cookbook example also includes the "wait waitports" which we need
> to exclude as we need to push data to the client as soon as it connects.
>
> Any input on how would you need to go about pushing a TCP data stream
> to multiple connected client ports at the same time.
>
> Thank you
> Leon
>
welcome Lean.
it seems even after all this time the regulars have not seen fit to make
regular use of Multitasking capability's of rebol but there is hope one day
they may be convinced of its benefit inside tunneled overlays for the
general web/net use point to multi-point etc :)
you might find Alfred Began's really Old fully working rebol multitasking
scripts useful and interesting to look at
http://www.rebolfrance.info/org/articles/multicast/multicast.html
it needs translation from french to English but his rebol scripts are
generic and he did us all a favour by putting them in side a sip and keeping
it available all time time so grab them and be happy.
i really do wonder what ever happened to him and his interesting sample code
idea's for Multicast though , shame hes not around innovating today that i
can find, but i dont read french so perhaps hes around still and we have
missed masses of interesting rebol code from him and his efforts...
heres a babblefish and a goggle translate of that page to make it effortless
for any interested readers and Multicast rebol coders, WE NEED FAR MORE
inventive working coders here that understand rebol at its most innovative
so keep up the good work ;)
http://babelfish.yahoo.com/translate_url?doit=done&tt=url&intl=1&fr=bf-home&
trurl=http%3A%2F%2Fwww.rebolfrance.info%2Forg%2Farticles%2Fmulticast%2Fmulti
cast.html&lp=fr_en&btnTrUrl=Translate
http://translate.google.com/translate?js=y&prev=_t&hl=en&ie=UTF-8&u=http%3A%
2F%2Fwww.rebolfrance.info%2Forg%2Farticles%2Fmulticast%2Fmulticast.html&sl=f
r&tl=en
and finally you may also find a use for this yet again old, yet innovative
use for stuffing Multicast down the Internet pipes
ohh for the the lack of the MBONE and the innovators there that wrote such
innovations, if only they could inspire a new generation today
http://www.cdt.luth.se/~peppar/progs/mTunnel/
" multicast Tunnel - mTunnel
----------------------------------------------------------------------------
----
The mTunnel is an application that tunnels multicast packets over an Unicast
UDP channel.
Several multicast streams can be sent over the same tunnel while the tunnel
will still only use one port.
This is useful if tunneling through a firewall.
The applications primary goal is to allow for easy tunneling of multicast
over for instance a modem and/or an ISDN connection.
The mTunnel has a built in Web-server allowing for easy access to
information about current tunnels.
This server listens by default on port 9000 on the machine where started.
The mTunnel also listens on session announcements for easier tunneling of
known sessions.
If you download and install this package please send me an email! :-)
([email protected])
The latest public version is 0.3 released 980102.
README Changelog
Download: Windows UNIX
This version is NOT compatible with earlier versions of mTunnel!
I have also written two papers about this application: Paper1 - 1998 Paper2
- 1997 "
--
Best regards,
david mailto:[email protected]
--
To unsubscribe from the list, just send an email to lists at rebol.com with
unsubscribe as the subject.
--
To unsubscribe from the list, just send an email to
lists at rebol.com with unsubscribe as the subject.