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

World: r3wp

[!Uniserve] Creating Uniserve processes

Philippe
28-Oct-2005
[234]
Hello, you could find a simple bench study I've made for my job about 
Uniserve vs Apache, on the Rebol Documentation Project (see http://www.rebdocproj.org/article.php3?id_article=181). 
It's in french, but with some charts.  Uniserve is very close to 
Apache 1.3 (and 2.0, not published).
Terry
2-Nov-2005
[235]
Uniserve under 1.3  when trying to run the CGI example on the main 
http page. .. ## Error in [uniserve] : Async Write phase failed !
Terry
21-Jan-2006
[236]
Nenad, do you have any docs on encapping Uniserve?
Dockimbel
21-Jan-2006
[237]
No, but next release includes an 'encap-fs library and an example 
of encapping Uniserve with all dependencies and modules.
Terry
21-Jan-2006
[238]
How's production coming?
Dockimbel
24-Jan-2006
[239]
Next release will be out when I'll find time to package it. It also 
needs new documentation to better explain the concept behind the 
framework.
Pekr
24-Jan-2006
[240x2]
Doc - so - will you release mysql protocol as 1.0 stable?
I think that we should finally go 1.0 after all those years - your 
code is of proven quality ...
Dockimbel
24-Jan-2006
[242]
I need to first fix the "bad handshake" random issue.
Pekr
24-Jan-2006
[243]
it is appearing? did not know that ...
Dockimbel
24-Jan-2006
[244]
moving to MySQL channel
Terry
24-Jan-2006
[245]
Looking forward to it Nenad.
Graham
25-Jan-2006
[246]
Is there any progress on encryption with Uniserve protocols ?
MichaelB
25-Jan-2006
[247x2]
Why does the following not work ? Anamonitor shows that the engage 
got into place, but the rate doesn't work. I seam to forget something,
 
with rebgui:

do %rebgui.r
display "test" [
    text "hello"
    do [
        face/rate: 5
        face/feel: context [
            engage: func [f a e][
                print 'bla
            ]
            redraw: detect: over: none
        ]
    ]
]
do-events


with vid:

x: layout [button "hallo"]

x/rate: 5
x/feel: context [
    engage: func [f a e][
        print 'bla
    ]
    redraw: detect: over: none
]

view x
do-events

???any help :-)
sorry wrong group
Dockimbel
25-Jan-2006
[249]
Encryption methods are application-depend, it's hard to built-in 
Uniserve's kernel a general purpose encryption for communication 
that'll fit well any case...The kernel have to remain general purpose. 
But it may provides some helping features to allow easier encryption 
integration. Do you have some design ideas how the kernel should 
help integrating encryption ?
Graham
25-Jan-2006
[250]
I think the problem I had is that uniserve either uses a terminating 
sequence, or a preset number of bytes.  If the size of each "packet" 
changes with encryption, how does one cope with that?
Volker
25-Jan-2006
[251]
encrypt only the data, not the protocol-infos?
Terry
4-Feb-2006
[252x4]
Still playing around with Uniserve... this is the most underated 
piece of Rebol wrok yet.  Looking forward to the next version.
grok wrok as work
Still have this context issue though.. goes like this.. 


If I have a service, and in that service i have a "on-received' event.. 
and I put a function within that event (aka, in the on-received function 
itself.. then it works fine.. but if I try to add the same function 
to an external file, so that, when I trigger the on-received function, 
it does a DO to the external file, that function now DOESN'T work? 
 Some kind of context issue, and how do you work around it?  If i 
have a 1000 pieces of code that needs to be processed with each event, 
do i need to bury the whole thing in the service?
And if I LOAD the external file, you would think it would bind it 
all globally, but it doesn't?
Dockimbel
4-Feb-2006
[256]
I don't understand clearly what is the problem. Do you have a small 
code example ?
Terry
4-Feb-2006
[257x7]
Again, this is a service.. 

on-received: func [data][
raw-input: copy to-string data 
if raw-input = "test" [print "works"]
]


But if I put the if raw-input = "test" [print "works"] line in a 
seperate file.. ie  process.r ,and do it like this.. 

on-received: func [data][
raw-input: copy to-string data 
do %./process.r
]


It doesn't work.. In fact, it seems difficult to put global functions 
that are truly global, anywhere.
Probably on the same note, it's hard to encap Uniserve, given the 
folder structure and the way services are loaded etc.
The way Uniserve sits now makes it more extensible if you want to 
easily add protocols, services etc., but the trade-off is complexity 
trying to do other things.
Im sure it's fine.. just trying to grok it.
I'm finding it difficult to follow what's happening.
But if that's what it takes to have a single server handling everything 
from POP to HTTP to direct TCP, then so be it.
Looking forward to what's coming down the pipe.. what features/changes 
are you adding?
Graham
4-Feb-2006
[264]
try do/args ...
Terry
4-Feb-2006
[265x2]
From the Uniserve docs.. "Your UniServe installation is OK, so you 
can now build your next killer-app ! ;-)"

I'm on it ;)
do/args ?  how would that work?
Graham
4-Feb-2006
[267x3]
do/args %./process.r raw-input
and change your process.r script to look at the arguments.
if process.r doesn't change, you shouldn't do it anyway.
Terry
4-Feb-2006
[270]
Seems it relates to this part (from the docs)  

Put all the service related code in the service definition. You can 
include external libraries of code if needed. Everything that's not 
inside the service definition block will be globally BIND-ed.
Graham
4-Feb-2006
[271]
#include external libraries of code if needed
Terry
4-Feb-2006
[272x5]
Ok.. i can add external libraries.. just after the install-service 
[ ..   BUT..

to write back to the client, you use "write-client" so if in my processing, 
but that function wont work.. it's a catch 22.
So simply put.. how can I process an incoming message using an external 
page of code, and be able to respond from that page?  

I may need to create an "OUTPUT" value (the response) and then use 
the 'write-client' function once Im back in the service ON-RECEIVED 
function?
That last bit works.. seems the global context  functions, such as 
'write-client' dont pass to the script that is being DOne
Ok.. so now I can run the external script by placing waiting till 
i finsh the external, and get back to the 'on-received' function... 
but I have a number of functions that I use to process my external 
script.. 
Do I need to load those functions with every on-received event???
For example:  
If I place this function just after the "install-service [ "

testFunk: func [it][print it]


and if at anytime i DO an external script that uses that function, 
it doesn't work
Volker
4-Feb-2006
[277x2]
Not used to uniserv much, but usually such things use contexts for 
services. so 
 install-service [testFunk: func [it][print it]
should be similar to
  make object![  testFunk: func [it][print it]
you could try
  install-service [  set 'testFunk func [it][print it]
if that is the problem. then testFunk should be globally.
Terry
4-Feb-2006
[279x5]
Hmm, that's it.
I see here a new law...  the query is exponentially  greater than 
the answer.
Also, it seems that this stuff is handled by a seperate module (for 
background processing)?
Nenad, do you have an y Task-master examples?
Another question.. where could I put a piece of code to handle unknown 
(aka unserviced) ports?  Should be able to create a catch-all or 
a port-analyzer etc... check for scanning or other security issues.