[Pharo-project] Zodiac - 1st delivery - A new (binary) socket stream
Hi, I would like to announce Zodiac, the project created in response to http://forum.world.st/WebClient-for-1-2-2-tt3485946.html#a3503921 according to the plan described in http://forum.world.st/SSL-HTTPS-SecureSocketStream-SSLSession-for-Pharo-Sque... You can follow the development by looking at the code in http://www.squeaksource.com/Zodiac.html Here is the first delivery: a new (binary) socket stream implementation. Warning: this is of course not yet code for general consumption, use the source and the comments. This is a proof of concept. This package has no further dependencies and does not add anything to system classes, it is thus safe to load. There are four stream classes, ZdcAbstractSocketStream, ZdcSimpleSocketStream, ZdcOptimizedSocketStream and ZdcSocketStream, inheriting from each other, adding successively more optimized implementations of the standard Smalltalk stream primitives. There is one helper class, ZdcIOBuffer to help in managing read and write buffers inside the streams. The interface towards Socket is also quite small (i.e. only a very small amount of the functionality in Socket is used). The 48 units tests as well as the functional test (see further) are all green on Pharo 1.2.x and 1.3 as well as on Squeak 4.2. The functional test is the following: Zinc HTTP Components recently got a its ZnNetworkingUtils class turned into a socket stream factory. By loading the new package Zinc-Zodiac from the ZincHTTPComponents repository, you can ask Zn to use the new socket stream implementation, like this: ZnNetworkingUtils default: ZnZodiacNetworkingUtils new. To reset, just do: ZnNetworkingUtils default: nil. The cool thing is: all of Zn's 151 unit tests, most doing actual HTTP client and server interactions (some over the internet) succeed using the new Zodiac socket stream implementation. Enjoy! Sven
Hi Sven, That's a really really news. I look forward when we will reach a stable point for Ocean to use Zodiac on top of it. FYI, Ocean is a re-implementation of Sockets (Netnameresolver, IpAddress, ....). Cheers, #Luc 2011/5/17 Sven Van Caekenberghe <sven@beta9.be>
Hi,
I would like to announce Zodiac, the project created in response to
http://forum.world.st/WebClient-for-1-2-2-tt3485946.html#a3503921
according to the plan described in
http://forum.world.st/SSL-HTTPS-SecureSocketStream-SSLSession-for-Pharo-Sque...
You can follow the development by looking at the code in
http://www.squeaksource.com/Zodiac.html
Here is the first delivery: a new (binary) socket stream implementation.
Warning: this is of course not yet code for general consumption, use the source and the comments. This is a proof of concept.
This package has no further dependencies and does not add anything to system classes, it is thus safe to load.
There are four stream classes, ZdcAbstractSocketStream, ZdcSimpleSocketStream, ZdcOptimizedSocketStream and ZdcSocketStream, inheriting from each other, adding successively more optimized implementations of the standard Smalltalk stream primitives. There is one helper class, ZdcIOBuffer to help in managing read and write buffers inside the streams. The interface towards Socket is also quite small (i.e. only a very small amount of the functionality in Socket is used).
The 48 units tests as well as the functional test (see further) are all green on Pharo 1.2.x and 1.3 as well as on Squeak 4.2.
The functional test is the following: Zinc HTTP Components recently got a its ZnNetworkingUtils class turned into a socket stream factory. By loading the new package Zinc-Zodiac from the ZincHTTPComponents repository, you can ask Zn to use the new socket stream implementation, like this:
ZnNetworkingUtils default: ZnZodiacNetworkingUtils new.
To reset, just do:
ZnNetworkingUtils default: nil.
The cool thing is: all of Zn's 151 unit tests, most doing actual HTTP client and server interactions (some over the internet) succeed using the new Zodiac socket stream implementation.
Enjoy!
Sven
Hi Luc, On 18 May 2011, at 08:00, Luc Fabresse wrote:
That's a really really news. I look forward when we will reach a stable point for Ocean to use Zodiac on top of it. FYI, Ocean is a re-implementation of Sockets (Netnameresolver, IpAddress, ....).
As I said the interface towards Socket is quite small, it should be really easy to plug in an alternative. Apart from connect/disconnect and isConnected/isDataAvailable there are two key methods: ZdcSimpleSocketStream>>fillBytes: bytes startingAt: offset count: count "Ask the socket to read count elements into bytes starting at offset. Do not wait. Return read count." ZdcSimpleSocketStream>>flushBytes: bytes startingAt: offset count: count "Ask the socket to write count bytes starting from offset. Wait. Fail if not successful" And then there is the logic to wait for input. The optimized versions build on this interface. Sven
On 5/17/2011 22:24, Sven Van Caekenberghe wrote:
Hi,
I would like to announce Zodiac, the project created in response to
http://forum.world.st/WebClient-for-1-2-2-tt3485946.html#a3503921
according to the plan described in
http://forum.world.st/SSL-HTTPS-SecureSocketStream-SSLSession-for-Pharo-Sque...
Some comments:
BTW, It will be (very) hard to get Pharo+WebClient+SSL+MacOSX working.
Not really. I just don't have a Mac, so all my Mac work is done in the few hours that I actually have access to one. The stuff that's missing in the Mac version of SqueakSSL isn't hard given a couple of days and a Mac and WebClient ran fine on Pharo last time I tried it.
- why was it [Cryptography] not used for SqueakSSL ?
Because the stated goal of SqueakSSL is to use the native platform bindings for SSL on each platform. For reasons of a) performance, b) upgradability, c) compliance, and d) size of implementation. FWIW, I'm not sure I follow your reasoning regarding Zodiac. As it stands, there are two working implementation of SSL: SqueakSSL and Cryptography. You could just use one of the two and contribute to either development if there are things you don't like about them. Cheers, - Andreas
participants (3)
-
Andreas Raab -
Luc Fabresse -
Sven Van Caekenberghe