Skip to content

Commit

Permalink
Merge pull request #187 from yassineim/patch-1
Browse files Browse the repository at this point in the history
an connection -> a connection
  • Loading branch information
Pushkar N Kulkarni committed Apr 24, 2020
2 parents c46a3d4 + aecc8a2 commit 056d5fe
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion README.md
Expand Up @@ -150,7 +150,7 @@ To close the socket of an open instance, the following function is provided:

### Listen on a socket (TCP/UNIX).

To use **BlueSocket** to listen for an connection on a socket the following API is provided:
To use **BlueSocket** to listen for a connection on a socket the following API is provided:
- `listen(on port: Int, maxBacklogSize: Int = Socket.SOCKET_DEFAULT_MAX_BACKLOG, allowPortReuse: Bool = true, node: String? = nil)`
The first parameter `port`, is the port to be used to listen on. The second parameter, `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 *50*. For server use, it may be necessary to increase this value. To allow the reuse of the listening port, set `allowPortReuse` to `true`. If set to `false`, a error will occur if you attempt to listen on a port already in use. The `DEFAULT` behavior is to `allow` port reuse. The last parameter, `node`, can be used to listen on a *specific address*. The value passed is an *optional String* containing the numerical network address (for IPv4, numbers and dots notation, for iPv6, hexidecimal strting). The `DEFAULT` behavior is to search for an appropriate interface. If `node` is improperly formatted a **SOCKET_ERR_GETADDRINFO_FAILED** error will be returned. If `node` is properly formatted but the address specified is not available, a **SOCKET_ERR_BIND_FAILED** will be returned.
- `listen(on path: String, maxBacklogSize: Int = Socket.SOCKET_DEFAULT_MAX_BACKLOG)`
Expand Down

0 comments on commit 056d5fe

Please sign in to comment.