Hello all,
Slightly OT, except that I am asking for the potential benefit of Squeak. Several years ago, I had problems with closing a server socket such that same service could be restarted on the same port. There must be a correct way to do this (too many products do it successfully for it to be a problem), but at the time I was told that ephemeral ("dynamically allocated") ports were the best solution. I got it working, but have regretted it due to fire walls and other criteria.
Can anyone point me to what I might have been doing wrong, and/or an example of how to do it correctly? Of course, stress testing start/stop of a Seaside server could be a nice place to start to verify that it is not a problem. However, I would ideally like to understand the problem so I won't walk into it again. Perhaps it was just a Windows bug???
Thanks,
Bill
Wilhelm K. Schwab, Ph.D. University of Florida Department of Anesthesiology PO Box 100254 Gainesville, FL 32610-0254
Email: bschwab@anest.ufl.edu Tel: (352) 846-1285 FAX: (352) 392-7029
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
Not sure in the windows world, but by design, sockets closed are held closed for two minutes in case late packets arrive. If you don't care about that you can set "socket reuse" on the socket before you close it.
Pardon me if this is brief, but I'm sending this from my iPhone!
On Feb 29, 2008, at 10:10 AM, "Bill Schwab" BSchwab@anest.ufl.edu wrote:
Hello all,
Slightly OT, except that I am asking for the potential benefit of Squeak. Several years ago, I had problems with closing a server socket such that same service could be restarted on the same port. There must be a correct way to do this (too many products do it successfully for it to be a problem), but at the time I was told that ephemeral ("dynamically allocated") ports were the best solution. I got it working, but have regretted it due to fire walls and other criteria.
Can anyone point me to what I might have been doing wrong, and/or an example of how to do it correctly? Of course, stress testing start/ stop of a Seaside server could be a nice place to start to verify that it is not a problem. However, I would ideally like to understand the problem so I won't walk into it again. Perhaps it was just a Windows bug???
Thanks,
Bill
Wilhelm K. Schwab, Ph.D. University of Florida Department of Anesthesiology PO Box 100254 Gainesville, FL 32610-0254
Email: bschwab@anest.ufl.edu Tel: (352) 846-1285 FAX: (352) 392-7029
squeak-dev@lists.squeakfoundation.org