maybe this helps

http://www.rebol.org/ml-display-thread.r?m=rmlZCZC

On 22.02.2010 11:02, Leon Meyer wrote:
>   Hi Graham
>
> Yes, I believe you are on the right track.
>
> I have downloaded a utility called Socketsniff. It proves that it keeps
> every Socket open on the server even if the client closes the socket (telnet
> being the client in this case).
>
> As the server script copies the multicast stream to every connected socket,
> the number of active sockets just grows and grows until the new socket
> requests are declined. After a couple of minutes I had 100 open sockets
> within only 2 active clients.
>
> How do I build-in a check in the script below to see if the client's tcp
> port is still active and if not, close that tcp socket?
>
> REBOL [ Title: "4550"]
>
>   mon-address: read make url! join "dns://" (read dns://)
>   inputmulticast: open/direct/binary udp://:6550
>   set-modes inputmulticast [multicast-groups: copy compose/deep[[239.2.0.81
> (mon-address)]] ]
>
> listen: open/direct/binary/no-wait tcp://:4550
> output-ports: copy []
>
> forever [
>      port: wait [listen inputmulticast]
>      case [
>          port = listen [
>              ; we got a new connection
>              ; let's add it to the list of output ports
>              append output-ports first listen
>          ]
>          'else [
>              ; some data incoming
>              data: copy inputmulticast
>              foreach port output-ports [
>                  insert port data
>              ]
>          ]
>      ]
> ]
>
> Thanks
> Leon
>
>
> -----Original Message-----
> From: [email protected] [mailto:[email protected]] On Behalf Of
> Graham Chiu
> Sent: Monday, February 22, 2010 7:46 AM
> To: [email protected]
> Subject: [REBOL] Re: Maximum number of listening ports
>
>
> What happens if you close each port as it opens .. does it affect the number
> of connections?
>
> On Mon, Feb 22, 2010 at 6:33 PM, Leon Meyer<[email protected]>  wrote:
>    
>> Hi
>>
>> I did some further testing. It seems there there could be a limitation
>> on the number of sockets or connections made.
>>
>> To speed up the failure result, I have setup a monitoring app that
>> 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
>> nets=
>>      
> tat
>    
>> command still shows the port as open. The rebol app fails with the
>> follow=
>>      
> ing
>    
>> error:
>>
>> ** Access Error: Cannot connect to listen port
>> ** Where: forever
>> ** Near: append output-ports first listen
>>      
>>>>          
>> Does it mean there is a problem with my rebol script or does my code
>> not release the every connection that is made. I have also noticed
>> that the memory usage for the rebol app is at 6Mb when it starts, but
>> gradually gr=
>>      
> ows
>    
>> over time to 15-20MB.
>>
>> Thanks.
>>
>> Best Regards
>> Leon Meyer
>>
>>
>>
>> =A0_____
>>
>> 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
>> is t=
>>      
> o
>    
>> forwards a Multicast stream to any TCP listening ports.
>> The script works 100%, but if there are a large number of requests
>> from a remote PC to the listening port, the rebcore process seems to
>> close the listen port eventually. This could sometimes only happen
>> after a couple o=
>>      
> f
>    
>> 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"]
>>
>> =A0mon-address: read make url! join "dns://" (read dns://)
>> =A0inputmulticast: open/direct/binary udp://:6550 =A0set-modes
>> inputmulticast [multicast-groups: copy compose/deep[[239.2.0=
>>      
> .81
>    
>> (mon-address)]] ]
>>
>> listen: open/direct/binary/no-wait tcp://:4550
>> output-ports: copy []
>>
>> forever [
>> =A0 =A0port: wait [listen inputmulticast] =A0 =A0case [ =A0 =A0 =A0
>> =A0port =3D listen [ =A0 =A0 =A0 =A0 =A0 =A0append output-ports first
>> listen =A0 =A0 =A0 =A0] =A0 =A0 =A0 =A0'else [ =A0 =A0 =A0 =A0 =A0
>> =A0data: copy inputmulticast =A0 =A0 =A0 =A0 =A0 =A0foreach port
>> output-ports [ =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0insert port data =A0 =A0
>> =A0 =A0 =A0 =A0] =A0 =A0 =A0 =A0] =A0 =A0]
>>
>>
>> Best Regards
>> Leon
>>
>>
>>
>> --
>> 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.
>
>    

-- 
To unsubscribe from the list, just send an email to 
lists at rebol.com with unsubscribe as the subject.

Reply via email to