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

World: r3wp

[!REBOL3 Schemes] Implementors guide

Graham
19-Jan-2010
[1652x2]
Looks like AIM still has free IMAP ... signing up again!
Signed up, sent myself a couple of emails to that account, and then 
managed to login and download using the imap protocol
Pekr
19-Jan-2010
[1654]
Graham - you are becoming a networking Guru :-)
Graham
19-Jan-2010
[1655x2]
Nah .. this stuff isn't at all hard.  Carl made scheme creation much 
easier than in r2
I suspect that the amount of detail put into making a bullet proof 
http scheme frightened everyone off!
Pekr
19-Jan-2010
[1657x2]
yes, probably ...
Any thoughts on the unification process of error handling, logging, 
timeouts, etc.?
Graham
19-Jan-2010
[1659]
Well, Carl is going to have to look at them .. but since my  schemes 
use the same method ... they are pretty unified :)
Carl
19-Jan-2010
[1660]
So, where's the best place to start... the one that best shows the 
basic template?
Graham
19-Jan-2010
[1661x2]
smtp I think ...
though that one is an early effort
Carl
19-Jan-2010
[1663x3]
So, not Daytime?
Graham: During your "journey" through this .. did you notice if there's 
a standard template that would make sense for various parts of the 
implementation?
Also, where and how would you like to see my comments?
Graham
19-Jan-2010
[1666x3]
I started with daytime, moved to smtp, and then ftp, fax and now 
imap.  I am using pretty much the same template with changes appropriate 
to the protocol.
I think docbase ... is the place
Daytime is too trivial to learn much from ... maybe FTP instead??
Carl
19-Jan-2010
[1669x2]
Ok.


My question above is whether there's a standard "core" that can be 
used across many protocols... a bit like net-utils or default protocol 
on R2.
I'll go with SMTP for now.  Looks simple enough.
Graham
19-Jan-2010
[1671x3]
The only standard stuff I use is ...
1. net-log
2. some parse rules and bitsets
3. some authentication stuff like cram-md5


I also stack the commands sent to the port and pop them off as the 
port is async ...
I do this in ftp, fax and imap .. but I should go back and do this 
for smtp as well
I was thinking of using net-log as a way to hook into the low level 
activity of the protocol so that I can patch it as needed when interacting 
with a GUI ... eg, for progress meters
Carl
19-Jan-2010
[1674]
Ok, good... then I'll start with IMAP... since it's more recent.
Graham
19-Jan-2010
[1675x2]
One thing that is not clear to me is that if you write to the port 

eg. write imap-port [ dialect stuff ]

and then 
wait imap-port


it can return immediately ... and you don't get anything unless you 
put in a timeout

eg. wait [ imap-port timeout ]
Ok, let me upload the latest version ....
Carl
19-Jan-2010
[1677]
Isn't that dependent on what you return from awake?
Graham
19-Jan-2010
[1678x3]
in wrote there is a 'read port .... but i don't get anyting back 
without the timeout
uploaded 0.0.3 

can login, select a mailbox, get length? and pick
It's at the bottom of the page as a file attachment
Carl
19-Jan-2010
[1681]
BTW, nice use of Deki wiki.
Graham
19-Jan-2010
[1682x2]
It looks pretty but is slower than docbase :)
and there's no REBOL formatting .. so I use ruby or whatever ...
Carl
19-Jan-2010
[1684]
Runs really fast here. Where's the server?
Graham
19-Jan-2010
[1685x4]
I think EC2
It was a free hosting offer I picked up a couple of years ago ...
That is Mindtouch were offering free wikis to people limited to 200Mb 
I think
Of course what I really like about it is that there is a REST based 
API that I can use with REBOL.
Pekr
19-Jan-2010
[1689]
Carl - guys found out, that we have just one shared buffer - why? 
You have to read everything out during read phase, or you can get 
corrupted data ....
Graham
19-Jan-2010
[1690]
pekr, what protocols are full duplex?
Pekr
19-Jan-2010
[1691]
none ... but wasn't it you, after all, who just wondered, why the 
in-out buffer is shared?
Graham
19-Jan-2010
[1692x2]
No .. I just pointed it out.
And wondering if that imposes a lot of GC ...
Carl
19-Jan-2010
[1694x4]
It's one of those things that's in the "balance".
It turns out, I think you can allocate separate buffers, but you 
must know how to do it... and I've not tried it yet, so have not 
mentioned it either.
But, I did give full duplex consideration during implementation. 
 I think more modern IM systems benefit from it.
Also, it turns out that one must be careful when estimating GC overhead. 
Sometimes it is more efficient, becuase otherwise you must add extra 
code to manage memory usage... that is constantly being run. You 
know what I mean?
Graham
19-Jan-2010
[1698]
It wouldn't be a big change to the schemes if that gets implemented 
right ?
Carl
19-Jan-2010
[1699x2]
Right. No change to schemes.
lunch time, bbl
Graham
19-Jan-2010
[1701]
I think in my ftp scheme I access port/data directly so I can stream 
to the file system .. so it would require a tiny change if there 
were two sep buffers