You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Changed SOCKET_DEFAULT_MAX_CONNECTIONS to SOCKET_DEFAULT_MAX_BACKLOG and changed the default from 5 to 50. Added SOCKET_MAX_DARWIN_BACKLOG for macOS. Changed the signature of listen(on port: Int, maxPendingConnections: Int) to listen(on port: Int, maxBacklogSize: Int = Socket.SOCKET_DEFAULT_MAX_BACKLOG) and removed the listen(on port: Int) API since the same can be accomplished using defaults. Updated documentation in README.md to reflect changes.
The first requires that you only specify a port upon which the socket will listen for connections. The second way allow you to limit the maximum number of incoming connection. In both cases, the function will determine the appropriate socket configuration based on the `port` specified.
62
+
To use **BlueSocket** to listen for an connection on a socket the following API is provided:
63
+
-`listen(on port: Int, maxBacklogSize: Int = Socket.SOCKET_DEFAULT_MAX_BACKLOG)`
64
+
The first parameter `port`, is the port to be used to listen on. The second paramete, `maxBacklogSize` allows you to set the size of the queue holding pending connections. The function will determine the appropriate socket configuration based on the `port` specified. For convenience on macOS, the constant `Socket.SOCKET_MAX_DARWIN_BACKLOG` can be set to use the maximum allowed backlog size. The default value for all platforms is `Socket.SOCKET_DEFAULT_MAX_BACKLOG`, currently set to *5*.
0 commit comments