Skip to content

Commit 27dc361

Browse files
UNIT 1.33.0 Add backlog parameter and accessor methods to Listener
Introduced a `backlog` property to define connection limits in the Listener. Added corresponding getter and setter methods for managing this property. Updated docblocks for improved clarity on Listener parameters.
1 parent dc36c7a commit 27dc361

File tree

3 files changed

+32
-2
lines changed

3 files changed

+32
-2
lines changed

.github/SECURITY.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ We use [SemVer](https://semver.org/) for versioning. For the versions available,
88

99
| Version | Nginx Unit Capability | Supported |
1010
|---------|:----------------------|--------------------|
11+
| 0.9.x | 1.33.0 | :white_check_mark: |
1112
| 0.8.x | 1.32.1 | :white_check_mark: |
1213
| < 0.7.x | - | :x: |
1314

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ server management into your projects
3030

3131
| Version | Nginx Unit Capability | Supported |
3232
|---------|:----------------------|--------------------|
33+
| 0.9.x | >= 1.33.0 | :white_check_mark: |
3334
| 0.8.x | <= 1.32.1 | :white_check_mark: |
3435
| < 0.7.x | - | :x: |
3536

src/Config/Listener.php

Lines changed: 30 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
Tls
99
};
1010
use Override;
11-
use UnitPhpSdk\Builders\EndpointBuilder;
1211
use UnitPhpSdk\Contracts\Arrayable;
1312
use UnitPhpSdk\Contracts\Jsonable;
1413
use UnitPhpSdk\Contracts\Uploadable;
@@ -37,10 +36,29 @@ class Listener implements Uploadable, Arrayable, Jsonable
3736

3837
public function __construct(
3938
private readonly string $listener,
39+
/**
40+
* Destination to which the listener passes incoming requests
41+
* @var string|ListenerPass
42+
*/
4043
string|ListenerPass $pass,
44+
/**
45+
* Defines SSL/TLS settings.
46+
* @var Tls|null
47+
*/
4148
private ?Tls $tls = null,
49+
/**
50+
* Configures client IP address and protocol replacement.
51+
* @var Forwarded|null
52+
*/
4253
private ?Forwarded $forwarded = null,
43-
) {
54+
/**
55+
* Controls the ‘backlog’ parameter to the listen(2) system-call.
56+
* This essentially limits the number of pending connections waiting to be accepted.
57+
* @var int
58+
*/
59+
private ?int $backlog = null
60+
)
61+
{
4462
$this->parsePort();
4563
$this->parsePass($pass);
4664

@@ -255,4 +273,14 @@ public function getTarget(): ListenerPass
255273
{
256274
return $this->getPass();
257275
}
276+
277+
public function getBacklog(): ?int
278+
{
279+
return $this->backlog;
280+
}
281+
282+
public function setBacklog(?int $backlog): void
283+
{
284+
$this->backlog = $backlog;
285+
}
258286
}

0 commit comments

Comments
 (0)