Leon,

What does this supposed to do?

set-modes inputmulticast [multicast-groups: copy
compose/deep[[239.2.0.81 (mon-address)]] ]

The case statement is like this:

case [
 condition [ ]
 condition [ ]
 true [ ]
]

Also, there's no 'continue ...


2010/2/25 Leon Meyer <[email protected]>:
>
> Thanks for the feedback up to now.
>
> I have know included an if statement to close the port if the COPY of =3D
> the
> port (connstatus) returns NONE (thanks Gabrielle).
>
> I also included an if statement to insert the inputmulticast to the port =
=3D
> if
> the COPY of the port (connstatus) does not equal NONE.
>
> Great, it works and ports are being closed now + memory no longer =3D
> increases
> as ports are removed from the list, but I have picked up an issue. If =3D
> the
> remote client hogs the port (in my case the telnet session to tcp port
> crashed), no other connections are possible from other tcp clients until
> that problem connection is closed. Then only can the rest of the =3D
> connections
> connect to the tcp server again.
>
> In the code below, I think I should have rather used "continue" in the =
=3D
> "if
> connstatus equals NONE" block, instead of the next "if connstatus not =3D
> equals
> NONE". But when I use "continue" I get an error that says it has no =3D
> value.
>
> "break" works, but I believe that would result in the remainder of the =
=3D
> ports
> in the ports list would not be forwarded the data for that loop cycle.=3D=
20
>
> Any feedback on the "One problem port stops all" issue perhaps?
>
> Code:
>
> REBOL [ Title: "4553"]
>
> =A0mon-address: read make url! join "dns://" (read dns://)
> =A0inputmulticast: open/direct/binary udp://:6553
> =A0set-modes inputmulticast [multicast-groups: copy =3D
> compose/deep[[239.2.0.81
> (mon-address)]] ]
>
> listen: open/direct/binary/no-wait tcp://:4553
> output-ports: copy []
>
> forever [
> =A0 =A0port: wait [listen inputmulticast]
> =A0 =A0case [port =3D3D listen [append output-ports first listen]
> =A0 =A0'else [data: copy inputmulticast foreach port output-ports [
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0connstatus: copy port
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0if none? connstatus [
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0close port
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0remove find output-ports p=
ort
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0]
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0if connstatus <> none [insert port data]
> =A0 =A0 =A0 =A0 =A0 ]
> =A0 =A0 =A0 =A0]
> =A0 =A0]
> ]
>
>
> -----Original Message-----
> From: [email protected] [mailto:[email protected]] On Behalf =
=3D
> Of
> Semseddin Moldibi
> Sent: Monday, February 22, 2010 9:53 AM
> To: [email protected]
> Subject: [REBOL] Re: Maximum number of listening ports
>
>
> There is a number of connections limitation on Windows OS, there is a
> setting on registry. And closed ports don't be released immediately, so =
=3D
> if
> you close and open too fast then you can reach the limit. The limit is
> different for OS versions.
>
> Mon, 22 Feb 2010 09:34:11 +0200 tarihinde Leon Meyer =3D
> <[email protected]>
> =3DFE=3DF6yle yazm=3DFD=3DFE:
>
>>
>> I do apologise, I posted in HTML format before , below is the post in =
=A0=3D
>
>> plain
>> text.
>>
>> Best Regards
>> Leon
>>
>>
>> ________________________________
>>
>> From: Leon Meyer [mailto:[email protected]]
>> Sent: Monday, February 22, 2010 7:33 AM
>> To: '[email protected]'
>> Subject: RE: Maximum number of listening ports
>>
>>
>> Hi
>> I did some further testing. It seems there there could be a limitation =
=3D
> on
>> the number of sockets or connections made.
>> To speed up the failure result, I have setup a monitoring app that =3D20
>> checks if
>> the socket is open every 2 seconds(connects and disconnects). After 30
>> minutes, I can no longer access the listening port, although Windows =3D=
20
>> netstat
>> command still shows the port as open. The rebol app fails with the =3D20
>> following
>> error:
>> ** Access Error: Cannot connect to listen port
>> ** Where: forever
>> ** Near: append output-ports first listen
> <k=3DFDrp=3DFDlm=3DFD=3DFE>
>> Does it mean there is a problem with my rebol script or does my code =3D
> not
>> release the every connection that is made. I have also noticed that =3D
> the
>> memory usage for the rebol app is at 6Mb when it starts, but gradually =
=3D
> =3D20
>> grows
>> over time to 15-20MB.
>> Thanks.
>>
>> Best Regards
>> Leon
>>
>>
>>
>> ________________________________
>>
>> From: Leon Meyer [mailto:[email protected]]
>> Sent: Saturday, February 20, 2010 12:43 PM
>> To: '[email protected]'
>> Subject: Maximum number of listening ports
>>
>>
>> Hi
>> We have been using a rebol script for a while now. Its main function =3D
> is =3D20
>> to
>> forwards a Multicast stream to any TCP listening ports.
>> The script works 100%, but if there are a large number of requests =3D
> from a
>> remote PC to the listening port, the rebcore process seems to close =3D
> the
>> listen port eventually. This could sometimes only happen after a =3D
> couple =3D20
>> of
>> days. Is there a limit on:
>> - the duration of the listen port being open?
>> - the number of requests that could made by the ?
>> Script:
>> REBOL [ Title: "4550"]
>> mon-address: read make url! join "dns://" (read dns://)
>> =A0inputmulticast: open/direct/binary udp://:6550
>> =A0set-modes inputmulticast [multicast-groups: copy =3D20
>> compose/deep[[239.2.0.81
>> (mon-address)]] ]
>> listen: open/direct/binary/no-wait tcp://:4550
>> output-ports: copy []
>> forever [
>> =A0 =A0 port: wait [listen inputmulticast]
>> =A0 =A0 case [
>> =A0 =A0 =A0 =A0 port =3D3D listen [
>> =A0 =A0 =A0 =A0 =A0 =A0 append output-ports first listen
>> =A0 =A0 =A0 =A0 ]
>> =A0 =A0 =A0 =A0 'else [
>> =A0 =A0 =A0 =A0 =A0 =A0 data: copy inputmulticast
>> =A0 =A0 =A0 =A0 =A0 =A0 foreach port output-ports [
>> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 insert port data
>> =A0 =A0 =A0 =A0 =A0 =A0 ]
>> =A0 =A0 =A0 =A0 ]
>> =A0 =A0 ]
>>
>> Best Regards
>> Leon
>>
>>
>
>
> --=3D20
> To unsubscribe from the list, just send an email to=3D20
> 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.
>
>



--=20
Graham Chiu
http://www.compkarori.co.nz:8090/
Synapse - the use from anywhere EMR.
-- 
To unsubscribe from the list, just send an email to 
lists at rebol.com with unsubscribe as the subject.

Reply via email to