Rebol Tcp/udp differences between Linux and Windows
[1/1] from: andy::flyingcat::com at: 23-Sep-2002 19:04
Hi:
I'm playing around with the same scripts on both Windows and Linux. (I
develop on Linux, and send out the scripts for people to look at under
Windows)
I've noticed a confusing difference between the two: basically, a
simple script works as I expect under Windows, but doesn't under Linux.
On Linux I get the "rotating, flashing R logo" in the lower right corner
of the main view of the netproblem.r window. On Windows I don't. I'm
not quite sure why I'm seeing the R logo at all. Can someone help
explain this behavior ?
I obviously don't want that R logo there :-)
Thanks,
Andy
Here's the netproblem.r script, and the "simulated remote" script which
I use to test things.
-----
REBOL [ ]
menu_key: func [input_line] [
print ["input line: " input_line]
either (stat = none) [
main/offset: 0x0
stat: "view"
view main
] [
if(input_line = "attention")[ print "attention!" stat:
none
unview main ]
]
]
main: layout/offset [
size 400x200
backcolor blue
style btn button font [colors: [254.254.254] ]
across
pad 0
return
at 20x100 btn 40x20 "Quit" with [effect: [1x0 tab ]] font [colors:
[100.100.100]] [ close fp quit ]
at 20x140 btn 40x20 "Halt" with [effect: [1x0 tab ]] font [colors:
[100.100.100]] [ halt ]
] 0x0
fp: open/lines udp://:5239
fp/awake: func [fp] [
print "awake"
command: to-string copy fp
command_block: parse command " "
user: command_block/1
menu_key command_block/2
true
]
insert tail system/ports/wait-list fp ; add my port to the system wait
queue
print "ready"
stat: none
forever [ wait none ]
close fp
----------------
Remote control
-----------------
REBOL [ ]
e: func [t] [
either error? try [
fp: open/write udp://localhost:5239 ][
err: "No Listener on port" ] [ insert fp rejoin [ "guest " t ]
close fp ]
]
std_size: 80x30
panel: layout [
backcolor gray
origin 0x00
space 1x1
pad 0x10
size 400x280
across
tabs 40
style button button with [ effect: [oval ] mycommand: none ] [ e
face/mycommand ]
button std_size "Menu" with [ mycommand: "attention" ]
tab tab
button std_size "Up" with [ mycommand: "cursor-up" ]
tab tab
button std_size "Power" with [ mycommand: "power" ]
return
button std_size "Zap left" with [ mycommand: "zap-left" ]
button std_size "Left" with [ mycommand: "cursor-left" ]
button std_size "Select" with [ mycommand: "select" ]
button std_size "Right" with [ mycommand: "cursor-right" ]
button std_size "Zap right" with [ mycommand: "zap-right" ]
return
tab
button std_size "Record" with [ mycommand: "record" ]
tab
button std_size "Down" with [ mycommand: "cursor-down" ]
tab
button std_size "Stop" with [ mycommand: "stop" ]
return
pad 0x10
button std_size "Vol +" with [ mycommand: "volume-up" ]
tab tab tab tab tab tab
button std_size "Channel +" with [ mycommand: "channel-up" ]
return
button std_size "Vol -" with [ mycommand: "volume-down" ]
tab
button 50x30 "1" with [ mycommand: "1" ]
button 50x30 "2" with [ mycommand: "2" ]
button 50x30 "3" with [ mycommand: "3" ]
tab tab
button std_size "Channel -" with [ mycommand: "channel-down" ]
return
button std_size "Mute" with [ mycommand: "mute" ]
pad 40x0
button 50x30 "4" with [ mycommand: "4" ]
button 50x30 "5" with [ mycommand: "5" ]
button 50x30 "6" with [ mycommand: "6" ]
tab tab
button std_size "Info" with [ mycommand: "information" ]
return pad 120x0
button 50x30 "7" with [ mycommand: "7" ]
button 50x30 "8" with [ mycommand: "8" ]
button 50x30 "9" with [ mycommand: "9" ]
return pad 120x0
button 50x30 "0" with [ mycommand: "0" ]
button 50x30 "*" with [ mycommand: "star" ]
button 50x30 "#" with [ mycommand: "pound" ]
tab tab
button std_size "Cancel" with [ mycommand: "cancel" ]
]
view/title panel "Remote Control"