I'm trying to make sven write a chapter :) So I added it to the server section :) Stef
Hi Sven,
That makes a lot of sense :).
Perhaps this could be added to the Getting Started section of the website?
Thanks!
Mark
On 8 Apr 2012, at 17:11, Sven Van Caekenberghe wrote:
Mark,
On 08 Apr 2012, at 16:11, Mark Smith wrote:
Hi all,
Is anyone else having problems with Zinc servers not starting up correctly when the image is loaded?
After the image starts up the server has an invalid socket handle.
To reproduce, evaluate the following in a workspace, then save and quit the image.
aServer := ZnServer on: 8080. aServer delegate: ((ZnMonticelloServerDelegate new) directory: (FileDirectory on: '/Users/sven/Tmp/monticello')). aServer start
Any ideas?
Mark
Only the default server (ZnServer default) is sent #register on #start so that it will be sent #start/#stop on System #startUp/#shutDown. Have a look at ZnSingleThreadedServer>>#start and/or follow ZnServer>>#register.
To make this work, either change your example to
aServer := ZnServer defaultOn: 8080. aServer delegate: ((ZnMonticelloServerDelegate new) directory: (FileDirectory on: '/Users/sven/Tmp/monticello')). aServer start
or to
aServer := ZnServer on: 8080. aServer delegate: ((ZnMonticelloServerDelegate new) directory: (FileDirectory on: '/Users/sven/Tmp/monticello')). aServer register. aServer start
It is by design that not every server is registered (as not everyone needs this behavior). The default server is an exception because it is used for first time and more casual usage and many people expect this behavior in Smalltalk.
HTH,
Sven
-- Sven Van Caekenberghe http://stfx.eu Smalltalk is the Red Pill