Next: The zsh/stat Module, Previous: The zsh/sched Module, Up: Zsh Modules [Contents][Index]
The zsh/net/socket module makes available one builtin command:
zsocket is implemented as a builtin to allow full use of shell command line editing, file I/O, and job control mechanisms.
Open a new Unix domain connection to filename. The shell parameter REPLY will be set to the file descriptor associated with that connection. Currently, only stream connections are supported.
If -d is specified, its argument will be taken as the target file descriptor for the connection.
In order to elicit more verbose output, use -v.
File descriptors can be closed with normal shell syntax when no longer needed, for example:
exec {REPLY}>&-
zsocket -l will open a socket listening on filename. The shell parameter REPLY will be set to the file descriptor associated with that listener. The file descriptor remains open in subshells and forked external executables.
If -d is specified, its argument will be taken as the target file descriptor for the connection.
In order to elicit more verbose output, use -v.
zsocket -a will accept an incoming connection to the socket associated with listenfd. The shell parameter REPLY will be set to the file descriptor associated with the inbound connection. The file descriptor remains open in subshells and forked external executables.
If -d is specified, its argument will be taken as the target file descriptor for the connection.
If -t is specified, zsocket will return if no incoming connection is pending. Otherwise it will wait for one.
In order to elicit more verbose output, use -v.
Next: The zsh/stat Module, Previous: The zsh/sched Module, Up: Zsh Modules [Contents][Index]