Why the serveraccept function in socket limit 50?

Why the serveraccept function in socket limit 50?

yexioamu
Not applicable
130 Views
2 Replies
Message 1 of 3

Why the serveraccept function in socket limit 50?

yexioamu
Not applicable

[ FlexSim 21.2.4 ]

Hello, when i create a server socket in flexsim, and send message by external system(WMS), becasue the external system has a lot of task, so it use thread to send message to flexsim server, it means flexsim server need to accept different connection from different port, i create new connetion in loop by code like this:

int client = serveraccept(1);
while(client == 0){
      clientclose(client);
      int client = serveraccept(1);
}

it work fine at first, but when the client value reach 50, it not work, does the return value of serveraccept is 50, it limit 50 connection?

Then, i solved it by ending the server and create a new server when the connections reach 50.

Could someone tell me the reason? Thanks!

0 Likes
Accepted solutions (1)
131 Views
2 Replies
Replies (2)
Message 2 of 3

Jacob_Gillespie
Autodesk
Autodesk
Accepted solution

Yes there is a limit of 50 connections. The problem is you aren't closing the socket correctly.

Instead of calling clientclose() you should be calling servercloseconnection().

Message 3 of 3

yexioamu
Not applicable

Thank you, it works fine! when i calling servercloseconnection(), the connection can be close correctly.

0 Likes