Mailing List Archive: 49091 messages
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search
 

[REBOL] Re: UDP Multicast to TCP

From: compkarori:gma:il at: 19-Nov-2009 16:08

open/binary ? On Fri, Nov 20, 2009 at 6:42 AM, Leon Meyer <lmeyer-bltech.co.za> wrote:
> =A0Hi > > Although the TCPtoMulticast and MulticastToUDP applications are working, we > have picked up an small problem. > > The Payload size of the UDP output packets after the conversion does not > seem to be exactly the same as the incoming TCP Payload size (always a > couple of bytes extra). The larger the incoming TCP payload size, the more > bytes seem to be added to the output UDP payload. We have confirmed this > using Windump (windows version of tcpdump). > > For example, =A0a 16 bytes TCP payload becomes a 17 bytes UDP payload > A 771 bytes payload becomes a 778 UDP payload. Does anyone have any idea > what could be causing the additional bytes in the UDP payload? Here is the > TCPtoUDP script: > > REBOL[Title: "Port 4550"] > > listen: open/no-wait tcp://:4550 > waitports: [listen] > > odata: open udp://239.2.0.80:6550 =A0 =A0 =A0; udp broadcast port > set-modes odata [multicast-ttl: 10] > set-modes odata [multicast-interface: 192.168.20.23] > > =A0 =A0forever [ > =A0 =A0 =A0 =A0port: wait waitports > =A0 =A0 =A0 =A0either same? port listen [ > =A0 =A0 =A0 =A0 =A0 =A0active-port: first listen > =A0 =A0 =A0 =A0 =A0 =A0append waitports active-port > =A0 =A0 =A0 =A0] [ > =A0 =A0 =A0 =A0 =A0 =A0incoming-from-remote: copy port > =A0 =A0 =A0 =A0 =A0 =A0either incoming-from-remote [ > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 insert odata incoming-from-remote > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 ;print incoming-from-remote > =A0 =A0 =A0 =A0 =A0 =A0] [ > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0remove find waitports port > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0close port > =A0 =A0 =A0 =A0 =A0 =A0] > =A0 =A0 =A0 =A0] > =A0 =A0] > > Thank you > Leon > > PS - I have removed the "read requests" from my email now- sorry if it > caused any problems yesterday. > > -----Original Message----- > From: rebol-bounce-rebol.com [mailto:rebol-bounce-rebol.com] On Behalf Of > Gabriele Santilli > Sent: Wednesday, November 18, 2009 12:50 PM > To: rebolist-rebol.com > Subject: [REBOL] Re: UDP Multicast to TCP > > On Wed, Nov 18, 2009 at 11:42 AM, Petr Krenzelok <petr.krenzelok-seznam.cz> > wrote: > >> I hope I am not wrong here, but you should know, that in R2, you >> basically can work in two modes - blocking (synchronous), and non >> blocking. When you open your port without /no-wait refinement, then >> 'copy action on port blocks. It is your case, as you issue "copy >> multicast", where multicast is opened in blocking mode. In this mode, >> copy waits for other side to close the connection. That might be the >> reason why your code "halts". Try simple example: > > Mmm, Petr, actually, he's only copying on the UDP port after a wait, so I > don't think this would be a problem. Besides, it seems to me that /no-wait > does not work on UDP listen ports... > >> Console1: >> --------- >> server: open tcp://:9005 > > Your assumption that UDP behaves just like TCP is so very wrong. ;) > > Regards, > =A0 =A0Gabriele. > -- > 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. >
-- Graham Chiu http://www.synapsedirect.com Synapse - the use from anywhere EMR.