unix_abstract/

directory
v0.0.0-...-775150f Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 13, 2025 License: Apache-2.0

README

Unix abstract sockets

This examples shows how to start a gRPC server listening on a unix abstract socket and how to get a gRPC client to connect to it.

What is a unix abstract socket

An abstract socket address is distinguished from a regular unix socket by the fact that the first byte of the address is a null byte ('\0'). The address has no connection with filesystem path names.

Try it

go run server/main.go
go run client/main.go

Explanation

The gRPC server in this example listens on an address starting with a null byte and the network is unix. The client uses the unix-abstract scheme with the endpoint set to the abstract unix socket address without the null byte. The unix resolver takes care of adding the null byte on the client. See https://github.com/grpc/grpc/blob/master/doc/naming.md for the more details.

Directories

Path Synopsis
Binary client is an example client which dials a server on an abstract unix socket.
Binary client is an example client which dials a server on an abstract unix socket.
Binary server is an example server listening for gRPC connections on an abstract unix socket.
Binary server is an example server listening for gRPC connections on an abstract unix socket.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL