[squeak-dev] Re: Closing a socket for port re-use - dumb question
Andreas Raab
andreas.raab at gmx.de
Fri Feb 29 18:19:22 UTC 2008
Bill Schwab wrote:
> Can anyone point me to what I might have been doing wrong, and/or an
> example of how to do it correctly?
Not unless you give some actual information like: What have you tried
already? Which port are you trying to run on? What happens when you
actually restart the server? Etc. As for an example, try this:
[true] whileTrue:[
server := Socket newTCP.
server listenOn: 1234 backlogSize: 4.
Transcript cr; show: server.
client := Socket newTCP.
client connectTo: NetNameResolver localHostAddress port: 1234.
Transcript cr; show: client.
socket := server accept.
Transcript cr; show: socket.
server destroy.
client destroy.
socket destroy.
].
I can leave this loop running forever so obviously there isn't any
intrinsic problem with running servers on the same port.
Cheers,
- Andreas
More information about the Squeak-dev
mailing list
|