[REBOL] A couple of things regarding ports Re:(7)

2000-09-19 Thread sqlab

Hello

--
[EMAIL PROTECTED] wrote:

Try something like:
dispatch [port1 [print "Port1"] port2 [print "Port2"]]
as your:
print first port1
may be waiting for input on 'port1.


the whole idea was to wait for data from the ports :)

however, if I do it like [print "Port1"]
I get spammed with a never ending list of Port1's,
allthough the other end of Port1 isn't sending anything,
and occasionally one or two Port2's..
something with the 'wait seems fishy enough?..

Cheers, malte

--

As long as you do not handle the port event correctly, you will get the
event always again.

You have to do something like [new-port: first serv-port] on the port
after
it gets a connection to satisfy the event handler.

It seems to be a behaviour of wait to give back unserviced data as new
until
they are removed from the port.

regards
AR



-- 
Sent through GMX FreeMail - http://www.gmx.net




[REBOL] A couple of things regarding ports Re:(7)

2000-09-18 Thread allen


- Original Message -
From: <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, September 18, 2000 9:00 PM
Subject: [REBOL] A couple of things regarding ports Re:(6)


>
> >Try something like:
> >dispatch [port1 [print "Port1"] port2 [print "Port2"]]
> >as your:
> >print first port1
> >may be waiting for input on 'port1.
>
> the whole idea was to wait for data from the ports :)
>
> however, if I do it like [print "Port1"]
> I get spammed with a never ending list of Port1's,
> allthough the other end of Port1 isn't sending anything,
> and occasionally one or two Port2's..
> something with the 'wait seems fishy enough?..

I've used 'dispatch in a basic /View chat script demo and it worked as
expected.

Try changing the port number to be sure nothing else on your system isn't
using the same port number. (If you are using windows kill off any other
REBOL processses that have accumulated in the taskmanager, they tend to hang
around if the View is closed but the ports weren't closed properly.)

read source for 'read-net, (which is used by 'request-download & 'read-via)
to see an example of 'dispatch code.

Cheers,

Allen K