r3wp [groups: 83 posts: 189283]
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search
 

World: r3wp

[!Cheyenne] Discussions about the Cheyenne Web Server

Terry
14-Jul-2010
[8554]
It's basically a one way websocket communication... server -> browser 
 . Not sure what the real advantage would be, perhaps less overhead?
Dockimbel
14-Jul-2010
[8555]
Interesting...Do you know if current browsers supporting ws, implement 
the EventSource interface too?
Terry
14-Jul-2010
[8556x6]
I believe Safari 5 does
yeah
here's a nice little tool
http://html5test.com
The latest Chrome does as well.
FF needs to step up to the plate
Section 9 "Connectionless push and other features" in the W3 doc 
is interesting.
Dockimbel
14-Jul-2010
[8562]
My Chrome 5.0.375.99 scores a "no" at Server-Sent Events :(
Terry
15-Jul-2010
[8563x3]
There's a Chrome 6
http://www.chromium.org/getting-involved/dev-channel#TOC-Windows
If you haven't tried Safari lately, check out Safari 5.. not bad.
Graham
15-Jul-2010
[8566x2]
Never!
Apple software installers try to get every apple product downloaded 
onto your pc ...
Terry
15-Jul-2010
[8568x2]
Don't they all?
Another advantage of web apps :) At least you can block the ads.
Terry
16-Jul-2010
[8570]
Scrap that whole Safari plug.. thing is buggy with websockets.
Endo
23-Jul-2010
[8571]
good site to test web sockets http://jwebsocket.org/index.htm
Endo
26-Jul-2010
[8572x2]
I wrote a very simple ws client protocol, http://rebolforum.com/index.cgi?f=printtopic&topicnumber=47
I write the pick function to return none if an error occurs. whole 
the function is inside an attempt
pick port 1 ;--> none
first port ;--> still return error

but "first port" actually same with "pick port 1", it calls "pick", 
how it returns error?
Graham
26-Jul-2010
[8574]
I can't read unformatted source code .. .but isn't your pick missing 
an integer parameter?s
Endo
26-Jul-2010
[8575]
yes when I paste it to the forum, all formatting goes out..
in http protocol scheme, pick takes just one argument, port.
Graham
26-Jul-2010
[8576x2]
Really??
Never noticed ... let me look
Endo
26-Jul-2010
[8578x2]
p: open ws://localhost/test
pick p 1 ;if no data returns none
first p ;if no data returns error (but it calls pick??)
oops, sorry, there is no "pick" in http.
it is in ftp.
Graham
26-Jul-2010
[8580]
heh .. I was looking and looking and trying to find new glasses ...!
Endo
26-Jul-2010
[8581]
in pop scheme also, document says: "Read the Nth message from the 
POP port"
but pick function takes just port as an argument.
Graham
26-Jul-2010
[8582x2]
I think that's because the docs are wrong
It only allows you to pick the first message ... so that's why it 
ignores the integer parameter
Endo
26-Jul-2010
[8584x2]
no, it works, and the pick function is (in pop)
pick: func [
	"Read the Nth message from the POP port" 
	port
][
	read-message port 1
]
oh yes. but it works in my ws scheme.
Graham
26-Jul-2010
[8586x2]
well, I don't have a pop account to test it now
but the source there says to read the first message ... not the nth
Endo
26-Jul-2010
[8588x2]
I put my ws protocol here http://www.moldibi.com/download/ws.txt
I confused because, first p simply calls pick, my pick function inside 
an attempt block, so it cannot return an error.

but "first port" returns an error, if no data. its not a big deal. 
but spent some hours on it, then I saw that "pick port 1" returns 
none instead of error (as expected)

So I don't know what is different between "first port" and "pick 
port 1"
Graham
26-Jul-2010
[8590]
I don't understand your question ...
Endo
26-Jul-2010
[8591x2]
anyway, not a big problem.
ws protocol works,
run the chat server (see the post on the forum)
p: open ws://localhost/chat
insert p "hello"
pick p 1
== "hello"
insert p "/nick endo"
pick p 1
== "server: you known as endo"
Graham
26-Jul-2010
[8593]
and pick p 1000000 is the same?
Endo
26-Jul-2010
[8594]
I guess so :)
Graham
26-Jul-2010
[8595]
some ports a pick is a bit meaningless
Endo
26-Jul-2010
[8596x4]
yes, you can use only pick port 1.
if no data, then it returns none, so you can simply poll it. it doesn't 
wait for the data.
ws protocol is event based in its specification, so made it as no-wait. 
then and event based protocol can be built on this.
syntax highlighted version http://www.moldibi.com/rebol/ws.html
Graham
26-Jul-2010
[8600]
net-utils/net-install ws self 80
NickA
27-Jul-2010
[8601x2]
Endo, for the moment, use 4 spaces for tabs, and you're formatting 
will stay intact.  I'll change the script to replace tabs with spaces.
Endo, I updated to script to maintain formatting in a few new ways 
:)
Endo
27-Jul-2010
[8603]
Thank you Nick.