ServerSocket Behavior

I’m starting to try to work with ServerSockets as a way to connect computers on the local network. In running the example project ServerSocketServerTest, after hitting Listen, it arbitrarily creates 12 sockets.

I don’t understand this behavior. I would think it would create none until another computer connects with the ServerSocket. Can anyone tell me what I’m missing here?

It creates a pool so they are ready. As clients connect, the connections are handed off to these sockets.

Thanks. Do you happen to know why 12? Is that something I can set? Does it change as more requests are made?

That would be the MinSocketsAvailable property. Read up on the class here:

http://documentation.xojo.com/index.php?title=ServerSocket&oldid=44849

I think the theory behind this is that a pre-allocated socket should be able to respond faster and the ServerSocket should be able to handle multiple incoming connections simultaneously.