Ryan Culpepper <email@example.com>
|(require racket/unix-socket)||package: unix-socket-lib|
(unix-socket-connect socket-path) →
input-port? output-port? socket-path : unix-socket-path?
If v is a path (path-string?), the length of v’s corresponding absolute path must be less than or equal to the platform-specific length (108 bytes on Linux, 104 bytes on BSD and Mac OS X). Example: "/tmp/mysocket".
If v is a bytestring (bytes?), it represents an abstract socket name, supported on ly on Linux. The first byte of v must be NUL, and its length must be less than or equal to 108 bytes. Such a value refers to a socket in the Linux abstract socket namespace. Example: #"\0mysocket".
Note that NUL bytes are allowed in abstract socket names. For example, #"\0abc" and #"\0abc\0" are both valid—
and different— abstract socket names.
Otherwise, returns #f.
socket-path : unix-socket-path? backlog : exact-nonnegative-integer? = 4
If socket-path refers to a filesystem path, binding the socket creates a file that must be deleted separately from closing the listener.
A unix socket listener acts as a synchronizable event. It is ready when a client connection is ready to be accepted (see unix-socket-accept), and its synchronization result is the listener itself.