View Bug with Event port?
[1/6] from: ptretter::charter::net at: 11-Jul-2003 20:17
Is this a bug?
rebol[]
waitports: []
listen: open/lines/direct/no-wait tcp://:9999
append waitports listen
go: does [
forever [
port: wait waitports
if port/scheme = 'event [probe port]
]
]
main: layout [b1: btn "Click ME" [go]]
view main
halt
---------------------
I am trying to figure out why port is picking up the event?
Paul Tretter
[2/6] from: rotenca:telvia:it at: 12-Jul-2003 15:38
Hi Paul,
> I am trying to figure out why port is picking up the event?
The awake function of the event port is called at every event and it pick the
port.
If you want to probe the port at every event:
ow: get in system/view 'wake-event
system/view/wake-event: func[port][probe port ow port]
---
Ciao
Romano
[3/6] from: ptretter:charter at: 12-Jul-2003 11:13
Actually, I don't really want the event port at all. I actually put the
event probe in there because to show the problem. I really wanted to
capture the tcp port since it was the only one in the waitports block. For
example:
port: wait waitports
There was no event port appended to the waitports block. So not sure why
port is getting or picking the event port when I only wanted the tcp port
that was all that waitports contained. I think its a bug as I can see where
that could screw stuff up alot expecially since it doesnt appear until the
window is closed.
Paul Tretter
[4/6] from: rotenca:telvia:it at: 12-Jul-2003 19:21
> Actually, I don't really want the event port at all
clear system/ports/wait-list
---
Ciao
Romano
[5/6] from: ptretter:charter at: 12-Jul-2003 13:19
Yeah that is an effective work around but are we not still looking at a bug?
That's what I want to determine so I can send it off to feedback. Just want
to gain some consensus.
Paul Tretter
[6/6] from: rotenca:telvia:it at: 12-Jul-2003 21:02
No, it is not a bug.
It is open-events, called by components/view installation:
open-events: func [][
if event-port [exit]
event-port: open [scheme: 'event]
event-port/awake: func [port] [wake-event port]
insert system/ports/wait-list event-port
]
when you wait something, you are indirectly waiting also
system/ports/wait-list
so you could:
insert system/ports/wait-list my-port
and then do a simple
wait none
or
wait []
example:
insert system/ports/wait-list 1
forever [wait none prin "."]
after 1 second your wait stop (it is not a good idea to put timer wait in the
system wait-list, but for testing purpose...)
---
Ciao
Romano