▼ |  | Unstable: May Change Without Warning

1 | Guidelines for Developing unstable Libraries
2 | Automata: Compiling State Machines
3 | Bytes
4 | Contracts
5 | Contracts for Macro Subexpressions
6 | Debugging
7 | Definitions
8 | Errors
9 | Futures
10 | Functions
11 | Hash Tables
12 | Interface-Oriented Programming for Classes
13 | Lazy Require
14 | Lists
15 | Logging
16 | Macro Testing
17 | Mark Parameters
18 | Match
19 | Open place expressions
20 | Options
21 | Parameter Groups
22 | Pretty-Printing
23 | Re-Contracting Identifiers
24 | Sandbox
25 | Sequences
26 | Strings
27 | Structs
28 | Struct Printing
29 | Syntax
30 | Temporal Contracts: Explicit Contract Monitors
31 | Unix Domain Sockets
32 | 2D Syntax

On this page:

unix-socket-available?
unix-socket-connect
unix-socket-path?

5.92
top ← prev up next →

### 31`` Unix Domain Sockets

This library is unstable; compatibility will not be maintained. See Unstable: May Change Without Warning for more information.

(require unstable/socket) | package: base

> value unix-socket-available? : boolean?

A boolean value that indicates whether unix domain sockets are available and supported on the current platform. The supported platforms are Linux and Mac OS X; unix domain sockets are not supported on Windows and other Unix variants.

> > procedure
> > (unix-socket-connect socket-path) |  | → |  |
> > input-port? |  | output-port?
> socket-path : unix-socket-path?

Connects to the unix domain socket associated with socket-path and returns an input port and output port for communicating with the socket.

> procedure (unix-socket-path? v) → boolean?
> v : any/c

Returns #t if v is a valid unix domain socket path for the current system, according to the following cases:

- If v is a path (path-string?), then the current platform must be either Linux or Mac OS X, and 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 Mac OS X). Example: "/tmp/mysocket".

- If v is a bytestring (bytes?), then the current platform must be Linux, v must start with a 0 (NUL) byte, 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".

Otherwise, returns #f.

top ← prev up next →