[ANN] A first port to Cuis of Sport and Swazoo

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
22 messages Options
12
Reply | Threaded
Open this post in threaded view
|

Re: [ANN] A first port to Cuis of Sport and Swazoo

garduino
HI Hannes:

2013/1/24 H. Hirzel <[hidden email]>:

> On 1/22/13, Germán Arduino <[hidden email]> wrote:
>> Thanks for the comments Hannes / Juan:
>>
>> I will look into it when have time, or if you prefer Hannes and want
>> to help I will integrate it when finish with Aida.
>>
>> Germán.
>>
>
> Hello Germán
>
> I did an installation test of https://github.com/garduino/Cuis-Swazoo
>
>  I followed the instructions in my fork of your work. I had updated
> the README.md
>
>  https://github.com/hhzl/Cuis-Swazoo
>
> The file in gave the Transcript error messages copied in below.
>
> Then I run all the tests which start with 'Swazoo'
>
> 57 of 57 pass
>
> Is this the full number?
>
No, the full number is 143 and the detail is in the attached pdf
(exported from a Google spreadsheet that I normally use to work in
ports).


> From http://www.swazoo.org/documentation.html
> I take the following test snippet
>
> "Here is the simplest recipe possible to make your Swazoo site
> running. "Doit" from a workspace:"
>
>     |site|
>     site := Site new name: 'test'. "name is just for convinience"
>     site host: 'localhost' ip: '127.0.0.1' port: 8888.
>     SwazooServer singleton addSite: site.
>     site start.
>
> RESULT: Class #Site is not known, FAILURE
>
Currently you should use SwazooSite instead Site.

(I'm not trying in an image now, only responding of memory)

For easier handling of the sites I developed (in the past) a sort of
console in differente variations (for Aida, Iliad (screenshot
attached)), I think that I should revamp now for Cuis and add the code
to Swazoo, what do you think?


>
> BTW 'convinience' should be 'convenience'
>

Sorry, but I do not have access to the swazoo site.

>
> Could you please include an updated version of the simple example on
> http://www.swazoo.org/documentation.html in your README.md
>
> https://github.com/garduino/Cuis-Swazoo
>
>

Annotated on my to-do list.


>
>
> Thank you for your work on porting a web server to Cuis.
>

Thank you for the encouragement!

> Kind regards
> Hannes
>

_______________________________________________
Cuis mailing list
[hidden email]
http://jvuletich.org/mailman/listinfo/cuis_jvuletich.org

Swazoo%20Port%20to%20Cuis%204.1%20-%20Hoja%201.pdf (56K) Download Attachment
AidaScribo Console.jpeg (31K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: [aida] [ANN] A first port to Cuis of Sport and Swazoo

Janko Mivšek
In reply to this post by Hannes Hirzel
Hi Hannes,

Dne 21. 01. 2013 16:12, piše H. Hirzel:

> Janko, a question
>
> On 1/21/13, Janko Mivšek <[hidden email]> wrote:
>> Germán,
>>
>> I put your process changes on VW Swazoo
>
>
> where is it?
>
>    http://www.swazoo.org/download.html
> does not have an entry for VW Swazoo alone.

I'm just upgrading download/install instructions. Thanks for notifying
on really ancient Swazoo docs :(

Best regards
Janko



> --Hannes
>
>> and here is the result, which is
>> probably least common denominator to all dialects:
>>
>>
>> HTTPServer>>start
>>  self loop isNil ifTrue:
>>    [self socket:
>>       (SwazooSocket serverOnIP: self ipCorrected port: self port).
>>    self socket listenFor: 128.
>>    self loop:
>>       [ [self acceptConnection] repeat]
>>            newProcess.
>>    self loop
>>       priority: Processor userBackgroundPriority;
>>       resume
>>    ]
>>
>>
>> Additionally:
>>
>> HTTPConnection>>interact
>>
>>   ...
>>
>>   self server isMultiThreading
>>     ifTrue:
>>       [self loop: interactionBlock newProcess.
>>        self loop
>>          priority: Processor userBackgroundPriority;
>>          resume]
>>     ifFalse: [interactionBlock value].
>>   ^self
>>
>>
>> ServerTest>>setUp doesn't seem to have the process problem (process is
>> not stored in any variable, so I propose to leave this method unchanged.
>>
>> Best regards
>> Janko
>>
>>
>> Dne 20. 01. 2013 16:59, piše Germán Arduino:
>>> Hi:
>>>
>>> The first versions of Sport and Swazoo working in Cuis 4.1 with all
>>> tests green are ready to install.
>>>
>>> The changes I did in Swazoo are:
>>>
>>>
>>> - Avoid Unicode support that don't exist in Cuis
>>>
>>>
>>> WebSocketConnection:
>>>
>>> fromUtf8: aString
>>> "Squeak specific"
>>>
>>> "gsa 14/01/2013 for Cuis port"
>>> "^[aString convertFromEncoding: #utf8] on: Error do: [:ex | aString ]
>>> ^ aString
>>>
>>>
>>> toUtf8: aString
>>> "Squeak specific"
>>> "
>>> | converter in out |
>>> converter := UTF8TextConverter new.
>>> in := aString readStream.
>>> out := WriteStream on: ''.
>>> [in atEnd] whileFalse:
>>> [converter nextPut: in next toStream: out].
>>> ^out contents
>>> "
>>> ^ aString.
>>>
>>>
>>> SwazooBuffer >>closeChunkTo: aSocket
>>>
>>> " gsa 18/01/2013 used String instead ByteString for Cuis"
>>> "chunk := ByteString new: 5."
>>>
>>>
>>> - Avoid #fork and #forkAt: calling #newProcess instead:
>>>
>>> HTTPServer >>start
>>>
>>> start
>>> | swazooProcess |
>>> self loop isNil ifTrue: [
>>> self socket:
>>> (SwazooSocket
>>> serverOnIP: self ipCorrected
>>> port: self port).
>>> self socket listenFor: 128.
>>> self loop: (swazooProcess _ [ [ self acceptConnection ] repeat ]
>>> newProcess).
>>> swazooProcess name: 'Swazoo ' , DateAndTime now asString.
>>> swazooProcess priority: Processor userBackgroundPriority.
>>> swazooProcess resume ].
>>>
>>> instead of the original code:
>>>
>>> start
>>> self loop isNil ifTrue: [
>>> self socket:
>>> (SwazooSocket
>>> serverOnIP: self ipCorrected
>>> port: self port).
>>> self socket listenFor: 128.
>>> self loop: ([ [ self acceptConnection ] repeat ] forkAt: Processor
>>> userBackgroundPriority) ].
>>>
>>>
>>>
>>> HTTPServer >>setUp
>>>
>>> setUp
>>> | socket swazooProcess |
>>> (Delay forMilliseconds: 100) wait.
>>> server _ HTTPServer new.
>>> swazooProcess _ [
>>> server
>>> ip: 'localhost';
>>> port: 8123.
>>> server start ] newProcess.
>>> swazooProcess name: 'Swazoo HTTPServer Test'.
>>> swazooProcess resume.
>>> (Delay forMilliseconds: 100) wait.
>>> " stream := (SocketAccessor newTCPclientToHost: 'localhost' port: 8123)
>>> readAppendStream"
>>> socket _ SpSocket
>>> connectToServerOnHost: 'localhost'
>>> port: 8123.
>>> stream _ SwazooStream socket: socket.
>>>
>>> instead of the original code:
>>>
>>> setUp
>>> | socket |
>>> (Delay forMilliseconds: 100) wait.
>>> server := HTTPServer new.
>>> [server ip: 'localhost'; port: 8123.
>>> server start]
>>> fork.
>>> (Delay forMilliseconds: 100) wait.
>>> " stream := (SocketAccessor newTCPclientToHost: 'localhost' port: 8123)
>>> readAppendStream"
>>> socket := SpSocket connectToServerOnHost:  'localhost' port: 8123.
>>> stream := SwazooStream socket: socket
>>>
>>>
>>> Other considerations:
>>>
>>> SpFilename >>underlyingFilename (This method do not exist, but do not
>>> exist neither in the original one click aida/pharo image)
>>>
>>> Security class don't exist neither in the pharo one click image.
>>>
>>> #trimSeparators, is named in SwazooMD5 but do not seems implemented.
>>>
>>>
>>>
>>>
>>> To install Sport and Swazoo, follow the next steps:
>>>
>>> 1. Take a new Cuis 4.1 image.
>>>
>>> 2. From GitHub / garduino clone in your computer the repos
>>> Cuis-Cryptography
>>> Cuis-CompatibilityWithOtherSmalltalks
>>> Cuis-Pharo14CompatibilityLayer
>>> Cuis-Sport
>>> Cuis-Swazoo
>>>
>>> 3. In a workspace run the next script:
>>>
>>> | slash repo |
>>> slash _ FileDirectory slash.
>>> repo := '/Users/Shared/YOURCODEREPOSITORYPATH/'.
>>> {
>>> repo, slash, 'Cuis-Cryptography', slash, 'Cuis-System-Hashing.pck.st' .
>>> repo, slash, 'Cuis-CompatibilityWithOtherSmalltalks', slash,
>>> 'Cuis-CompatibilityWithOtherSmalltalks.pck.st' .
>>> repo, slash, 'Cuis-Pharo14CompatibilityLayer', slash,
>>> 'Cuis-Network-Protocols.pck.st' .
>>> repo, slash, 'Cuis-Pharo14CompatibilityLayer', slash,
>>> 'Cuis-Network-Url.pck.st' .
>>> repo, slash, 'Cuis-Sport', slash, 'Sport.pck.st' .
>>> repo, slash, 'Cuis-Swazoo', slash, 'Swazoo.pck.st' .
>>> }
>>> do:
>>> [ :fileName | CodePackageFile installPackageStream:
>>> (FileStream concreteStream readOnlyFileNamed: fileName)
>>> ].
>>>
>>>
>>> 4. You will notice some warnings in the Transcript regarding some
>>> Network-* classes, it is because I'm installing here only the minimum
>>> code that I need for Swazoo and I must still end to polish the delta
>>> between the Network protocol in Cuis vs Pharo/Squeak
>>>
>>> 5. I did also an early port of TimeStamp, not existing in Cuis, and I
>>> have still 1 failing test.
>>>
>>>
>>> But Swazoo seems to work ok, all the test pass and the tests I did in
>>> the workspace seems to work, but as I'm not in expert in Swazoo, I
>>> will be more than happy of receive corrections, suggestion, etc, to
>>> leave the port in a stable state.
>>
>> --
>> Janko Mivšek
>> Aida/Web
>> Smalltalk Web Application Server
>> http://www.aidaweb.si
>>
>> _______________________________________________
>> Cuis mailing list
>> [hidden email]
>> http://jvuletich.org/mailman/listinfo/cuis_jvuletich.org
>>
> _______________________________________________
> Aida mailing list
> [hidden email]
> http://lists.aidaweb.si/mailman/listinfo/aida
>

--
Janko Mivšek
Svetovalec za informatiko
Eranova d.o.o.
Ljubljana, Slovenija
www.eranova.si
tel:  01 514 22 55
faks: 01 514 22 56
gsm: 031 674 565

_______________________________________________
Cuis mailing list
[hidden email]
http://jvuletich.org/mailman/listinfo/cuis_jvuletich.org
12