serversocket question

I ran the example project ServerSocketServerTest, after hitting Listen, it arbitrarily creates 12 sockets. Why 12 socket in the socket pool? Should it behave like when a client trying to connect to server, then it will start a new socket?

I also tried to manipulate the “Minimum” and “Maximum” property in the Inspector for my serversocket, but nothing changes. (I save the example proj as an copy to do that.) I set the Minimum = 2, Maximum = 5. When I hit listen, it still creates 12 sockets. I suppose the Minimum is the “MinimumSocketsAvailable” and Maximum is the “MaximumSocketsConnected” mentioned in the document. http://documentation.xojo.com/index.php/ServerSocket

I also read this post, ServerSocket Behavior - General - Xojo Programming Forum. But it looks like no further answer is given out.

The both are not related:
ServerSocket. MaximumSocketsConnected
ServerSocket.MinimumSocketsAvailable

MaximumSocketsConnected says how many connections the ServerSocket should allow on the same time.

MinimumSocketsAvailable says how many sockets should be pre-created in the pool. The pool will always contain at least MinimumSocketsAvailable, but usually 10 or so more. The reason is that creating a socket is time-wise expensive.

I usually set MinimumSocketsAvailable to 2 * MaximumSocketsConnected.

[quote=230850:@Eli Ott]The both are not related:
ServerSocket. MaximumSocketsConnected
ServerSocket.MinimumSocketsAvailable

MaximumSocketsConnected says how many connections the ServerSocket should allow on the same time.

MinimumSocketsAvailable says how many sockets should be pre-created in the pool. The pool will always contain at least MinimumSocketsAvailable, but usually 10 or so more. The reason is that creating a socket is time-wise expensive.

I usually set MinimumSocketsAvailable to 2 * MaximumSocketsConnected.[/quote]
Thanks for your reply.
But more confused me is when I set a break point and in debug, I saw the property “MinimumSocketsAvailable” grab the number I put into “Minimum” in the inspector, same as “MaximumSocketsConnected”.
So my understanding is, if I set “Minimum”/“MinimumSocketsAvailable” to 2, the serversocket should create the socket pool only contains 2 members. Am I right?
Anyway, if, just for example, I want the server only creates 2 sockets at this time, instead of 12, is that possible and how?

No, it creates at least 10 more. That is way it is called a pool. A pool contains pre-created instances.

No. And it is not necessary for you to control that.

What are you trying to accomplish?

Okay, now I get it. It’s really confusing when I saw the “Minimum” and “Maximum” in the inspector. Now, I feel better.

I’m trying to create a TCP connection between a PC and a embedded device. They are already connected by serial connection, but TCP is a kind of backup connection plan. Nothing fancy, just make them “talk”. I don’t have to control the socket pool number, just curious about that.