andig · GitHub

Merged

Merged

Conversation

@andig andig mentioned this pull request

Oct 7, 2017

Closed

@WyriHaximus

clue

@andig andig mentioned this pull request

Oct 7, 2017

Merged

4 tasks

@andig

jsor

if (strpos($path, '://') === false) {
$path = 'unix://' . $path;
} elseif (substr($path, 0, 7) !== 'unix://') {
throw new \InvalidArgumentException('Given URI "' . $path . '" is InvalidArgumentException');

WyriHaximus

To listen on a Unix domain socket, the uri MUST be prefixed with the `unix://` scheme:

```php
$server = new Server('unix:///tmp/.sock', $loop);
}

/**
* @covers React\EventLoop\StreamSelectLoop::tick
}

/**
* @covers React\EventLoop\StreamSelectLoop::tick

private function getRandomSocketUri()
{
return "unix://" . sys_get_temp_dir() . DIRECTORY_SEPARATOR . uniqid(rand(), true) . '.sock';

kelunik


if (strlen($path) > 104) {
return Promise\reject(new InvalidArgumentException('Given URI "' . $path . '" exceeds maximum allowed length of 104 bytes'));
$maxLen = PHP_OS === 'Darwin' ? 104 : 108;

kelunik

// string > 104 characters
$path = "unix://" . sys_get_temp_dir() . DIRECTORY_SEPARATOR . str_repeat('_', 100) . '.sock';
// string > 104/108 characters
$path = "unix://" . sys_get_temp_dir() . DIRECTORY_SEPARATOR . str_repeat('_', 104) . '.sock';

kelunik


public function testConnectWithOverlyLongAddress()
{
https://serverfault.com/questions/641347/check-if-a-path-exceeds-maximum-for-unix-domain-socket

@clue clue mentioned this pull request

Oct 10, 2017

Closed

@andig

the-eater

$server = new SecureServer($server, $loop, $context['tls']);
if ($scheme === 'tls') {
$server = new SecureServer($server, $loop, $context['tls']);
}

@andig andig mentioned this pull request

Oct 22, 2017

Merged

5 tasks

clue


$maxLen = PHP_OS === 'Darwin' ? 104 : 108;
if (strlen($path) > $maxLen) {
return Promise\reject(new InvalidArgumentException('Given URI "' . $path . '" exceeds maximum allowed length'));

@clue

clue

clue approved these changes Nov 13, 2017

@clue clue changed the title Add unix server Support Unix domain socket (UDS) server

Nov 13, 2017

jsor

jsor approved these changes Nov 16, 2017

WyriHaximus

@WyriHaximus

@andig

Read the original on github.com ↗