amphp / socket

Non-blocking socket and TLS functionality for PHP based on Amp.
https://amphp.org/socket
MIT License
231 stars 38 forks source link

Unix Domain Socket support (UDS) #113

Closed Tofandel closed 2 days ago

Tofandel commented 2 months ago

Is there any plan to support unix sockets like

$server = Socket\listen("server.sock");

while ($client = $server->accept()) {
    // You shouldn't spend too much time here, because that blocks accepting another client, so we use async():
    async(function () use ($client) {
        // Handle client connection here
    });
}
bwoebi commented 2 months ago

You just have to give it a proper scheme, e.g.unix://server.sock.