[Pharo-project] Zinc: Detect failed binds
Hi :), Does anyone know if there's a way to detect if a Zinc Server doesn't bind to a port, (probably because there's already a server listening on that port), and signal an error? Thanks a lot, Mark
Mark, On 13 Jun 2012, at 12:09, Mark Smith wrote:
Hi :),
Does anyone know if there's a way to detect if a Zinc Server doesn't bind to a port, (probably because there's already a server listening on that port), and signal an error?
Thanks a lot,
Mark
Good question. Try server isRunning & server isListening as is done by most unit tests using #withServerDo: HTH, Sven -- Sven Van Caekenberghe http://stfx.eu Smalltalk is the Red Pill
Thanks Sven. That's working now :). On 13 Jun 2012, at 11:22, Sven Van Caekenberghe wrote:
Mark,
On 13 Jun 2012, at 12:09, Mark Smith wrote:
Hi :),
Does anyone know if there's a way to detect if a Zinc Server doesn't bind to a port, (probably because there's already a server listening on that port), and signal an error?
Thanks a lot,
Mark
Good question.
Try
server isRunning & server isListening
as is done by most unit tests using #withServerDo:
HTH,
Sven
-- Sven Van Caekenberghe http://stfx.eu Smalltalk is the Red Pill
Mark Smith wrote:
Hi :),
Does anyone know if there's a way to detect if a Zinc Server doesn't bind to a port, (probably because there's already a server listening on that port), and signal an error?
Thanks a lot,
Mark
As a backup plan... why not from one code path (perhaps requiring a fork) 1. start Zinc Server 2. generate random magic number 3. connect to server as a client requesting magic number. 4. check returned magic number matches the one from (2)
participants (3)
-
Ben Coman -
Mark Smith -
Sven Van Caekenberghe