Merge branch 'master' into allocator_improvements
This commit is contained in:
commit
1eae113314
15
README.md
15
README.md
|
@ -63,11 +63,13 @@ the issue.)
|
||||||
# Sockets
|
# Sockets
|
||||||
## TCP
|
## TCP
|
||||||
On Windows DCD will use TCP sockets to communicate between the client and server.
|
On Windows DCD will use TCP sockets to communicate between the client and server.
|
||||||
Other operating systems can use TCP sockets if the client and server use the `--tcp`
|
DCD can use TCP sockets on other operating systems if the client and server use
|
||||||
command-line switch.
|
the `--tcp` or `--port` command-line switches.
|
||||||
|
|
||||||
## UNIX domain sockets
|
## UNIX domain sockets
|
||||||
Operating systems that support UNIX domain sockets will use them by default.
|
Operating systems that support UNIX domain sockets will use them by default.
|
||||||
|
The path to the socket file can be overriden with the `--socketFile` option.
|
||||||
|
These are the default paths:
|
||||||
|
|
||||||
#### OSX
|
#### OSX
|
||||||
The socket will be created at `/var/tmp/dcd-${UID}.socket`
|
The socket will be created at `/var/tmp/dcd-${UID}.socket`
|
||||||
|
@ -75,7 +77,7 @@ The socket will be created at `/var/tmp/dcd-${UID}.socket`
|
||||||
#### Linux/BSD
|
#### Linux/BSD
|
||||||
The client and server will attempt to create the socket in the following locations:
|
The client and server will attempt to create the socket in the following locations:
|
||||||
* `${XDG_RUNTIME_DIR}/dcd.socket`
|
* `${XDG_RUNTIME_DIR}/dcd.socket`
|
||||||
* `/tmp/dcd-${UID}.socket`
|
* `/tmp/dcd-${UID}.socket` if `XDG_RUNTIME_DIR` is not defined.
|
||||||
|
|
||||||
# Client
|
# Client
|
||||||
Because DCD is designed to be used from a text editor, this section is written
|
Because DCD is designed to be used from a text editor, this section is written
|
||||||
|
@ -214,7 +216,7 @@ in place of a file being edited.)
|
||||||
#Server
|
#Server
|
||||||
The server must be running for the DCD client to provide autocomplete information.
|
The server must be running for the DCD client to provide autocomplete information.
|
||||||
In future versions the client may start the server if it is not running, but for
|
In future versions the client may start the server if it is not running, but for
|
||||||
now it must be started manually or by an editor plugin.
|
now it must be started manually or (usually) by an editor plugin.
|
||||||
|
|
||||||
## Configuration Files
|
## Configuration Files
|
||||||
The server will attempt to read the file ```${XDG_CONFIG_HOME}/dcd/dcd.conf```
|
The server will attempt to read the file ```${XDG_CONFIG_HOME}/dcd/dcd.conf```
|
||||||
|
@ -235,7 +237,7 @@ What you actually want is this:
|
||||||
/usr/include/dmd/phobos
|
/usr/include/dmd/phobos
|
||||||
|
|
||||||
##Shut down the server
|
##Shut down the server
|
||||||
The server can be shut down by running the client with the correct option:
|
The server can be shut down by running the client with the `--shutdown` option:
|
||||||
|
|
||||||
dcd-client --shutdown
|
dcd-client --shutdown
|
||||||
|
|
||||||
|
@ -245,4 +247,5 @@ Import directories can be specified on the command line at startup:
|
||||||
dcd-server -I/home/user/code/one -I/home/user/code/two
|
dcd-server -I/home/user/code/one -I/home/user/code/two
|
||||||
|
|
||||||
## Port number
|
## Port number
|
||||||
The ```--port``` or ```-p``` option lets you specify the port number that the server will listen on.
|
The ```--port``` or ```-p``` option lets you specify the port number that the
|
||||||
|
server will listen on. The default port is 9166.
|
||||||
|
|
2
dub.json
2
dub.json
|
@ -1,7 +1,7 @@
|
||||||
{
|
{
|
||||||
"name": "dcd",
|
"name": "dcd",
|
||||||
"description": "The D Completion Daemon is an auto-complete program for the D programming language",
|
"description": "The D Completion Daemon is an auto-complete program for the D programming language",
|
||||||
"copyright": "Copyright © 2015, Brian Schott",
|
"copyright": "Copyright © 2015-2016, Brian Schott",
|
||||||
"authors": [
|
"authors": [
|
||||||
"Brian Schott"
|
"Brian Schott"
|
||||||
],
|
],
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
.TH dcd-client 1 "Jan 15 2016" "" https://github.com/Hackerpilot/DCD
|
.TH dcd-client 1 "Mar 3 2016" "" https://github.com/Hackerpilot/DCD
|
||||||
.SH NAME
|
.SH NAME
|
||||||
dcd-client \- autocompletion client for the D programming language
|
dcd-client \- autocompletion client for the D programming language
|
||||||
.PD
|
.PD
|
||||||
|
@ -36,9 +36,7 @@ position is measured in bytes from the beginning of the source code.
|
||||||
.RS
|
.RS
|
||||||
Choose the port number on which
|
Choose the port number on which
|
||||||
.B dcd-client
|
.B dcd-client
|
||||||
listens. This has no effect unless
|
listens. This switch implies \-\-tcp.
|
||||||
.B dcd-client
|
|
||||||
is being run on Windows or the \-\-tcp switch is used.
|
|
||||||
.RE
|
.RE
|
||||||
.B \-\-tcp
|
.B \-\-tcp
|
||||||
.RS
|
.RS
|
||||||
|
@ -49,7 +47,7 @@ Windows.
|
||||||
.I filePath
|
.I filePath
|
||||||
.RS
|
.RS
|
||||||
Set the path to use for the UNIX domain socket. Has no effect if the \-\-tcp
|
Set the path to use for the UNIX domain socket. Has no effect if the \-\-tcp
|
||||||
switch is used.
|
or \-\-port switches are used.
|
||||||
.RE
|
.RE
|
||||||
.B \-I
|
.B \-I
|
||||||
.I directory
|
.I directory
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
.TH dcd-server 1 "Jan 15 2016" "" https://github.com/Hackerpilot/DCD
|
.TH dcd-server 1 "Mar 3 2016" "" https://github.com/Hackerpilot/DCD
|
||||||
.SH NAME
|
.SH NAME
|
||||||
dcd-server \- autocompletion server for the D programming language
|
dcd-server \- autocompletion server for the D programming language
|
||||||
.PD
|
.PD
|
||||||
|
@ -22,9 +22,7 @@ dcd-server \- autocompletion server for the D programming language
|
||||||
.RS
|
.RS
|
||||||
Choose the port number on which
|
Choose the port number on which
|
||||||
.B dcd-server
|
.B dcd-server
|
||||||
listens. This has no effect unless
|
listens. This switch implies \-\-tcp.
|
||||||
.B dcd-server
|
|
||||||
is being run on Windows or the \-\-tcp switch is used.
|
|
||||||
.RE
|
.RE
|
||||||
.B \-\-tcp
|
.B \-\-tcp
|
||||||
.RS
|
.RS
|
||||||
|
@ -35,7 +33,7 @@ Windows.
|
||||||
.I filePath
|
.I filePath
|
||||||
.RS
|
.RS
|
||||||
Set the path to use for the UNIX domain socket. Has no effect if the \-\-tcp
|
Set the path to use for the UNIX domain socket. Has no effect if the \-\-tcp
|
||||||
switch is used.
|
or \-\-port switches are used.
|
||||||
.RE
|
.RE
|
||||||
.B \-\-logLevel
|
.B \-\-logLevel
|
||||||
.I level
|
.I level
|
||||||
|
|
|
@ -40,7 +40,7 @@ int main(string[] args)
|
||||||
|
|
||||||
size_t cursorPos = size_t.max;
|
size_t cursorPos = size_t.max;
|
||||||
string[] importPaths;
|
string[] importPaths;
|
||||||
ushort port = 9166;
|
ushort port;
|
||||||
bool help;
|
bool help;
|
||||||
bool shutdown;
|
bool shutdown;
|
||||||
bool clearCache;
|
bool clearCache;
|
||||||
|
@ -102,6 +102,14 @@ int main(string[] args)
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// If the user specified a port number, assume that they wanted a TCP
|
||||||
|
// connection. Otherwise set the port number to the default and let the
|
||||||
|
// useTCP flag deterimen what to do later.
|
||||||
|
if (port != 0)
|
||||||
|
useTCP = true;
|
||||||
|
else
|
||||||
|
port = DEFAULT_PORT_NUMBER;
|
||||||
|
|
||||||
if (useTCP)
|
if (useTCP)
|
||||||
socketFile = null;
|
socketFile = null;
|
||||||
|
|
||||||
|
|
|
@ -28,6 +28,8 @@ version (linux) version = haveUnixSockets;
|
||||||
version (BSD) version = haveUnixSockets;
|
version (BSD) version = haveUnixSockets;
|
||||||
version (FreeBSD) version = haveUnixSockets;
|
version (FreeBSD) version = haveUnixSockets;
|
||||||
|
|
||||||
|
enum DEFAULT_PORT_NUMBER = 9166;
|
||||||
|
|
||||||
string generateSocketName()
|
string generateSocketName()
|
||||||
{
|
{
|
||||||
version (haveUnixSockets)
|
version (haveUnixSockets)
|
||||||
|
|
|
@ -56,7 +56,7 @@ version(OSX) version = useXDG;
|
||||||
|
|
||||||
int main(string[] args)
|
int main(string[] args)
|
||||||
{
|
{
|
||||||
ushort port = 9166;
|
ushort port;
|
||||||
bool help;
|
bool help;
|
||||||
bool printVersion;
|
bool printVersion;
|
||||||
bool ignoreConfig;
|
bool ignoreConfig;
|
||||||
|
@ -107,6 +107,17 @@ int main(string[] args)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// If the user specified a port number, assume that they wanted a TCP
|
||||||
|
// connection. Otherwise set the port number to the default and let the
|
||||||
|
// useTCP flag deterimen what to do later.
|
||||||
|
if (port != 0)
|
||||||
|
useTCP = true;
|
||||||
|
else
|
||||||
|
port = DEFAULT_PORT_NUMBER;
|
||||||
|
|
||||||
|
if (useTCP)
|
||||||
|
socketFile = null;
|
||||||
|
|
||||||
version (Windows) if (socketFile !is null)
|
version (Windows) if (socketFile !is null)
|
||||||
{
|
{
|
||||||
fatal("UNIX domain sockets not supported on Windows");
|
fatal("UNIX domain sockets not supported on Windows");
|
||||||
|
|
Loading…
Reference in New Issue