MCPcopy Create free account
hub / github.com/nsf/gocode / do_server

Function do_server

server.go:17–48  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

15)
16
17func do_server() int {
18 g_config.read()
19 if g_config.ForceDebugOutput != "" {
20 // forcefully enable debugging and redirect logging into the
21 // specified file
22 *g_debug = true
23 f, err := os.Create(g_config.ForceDebugOutput)
24 if err != nil {
25 panic(err)
26 }
27 log.SetOutput(f)
28 }
29
30 addr := *g_addr
31 if *g_sock == "unix" {
32 addr = get_socket_filename()
33 if file_exists(addr) {
34 log.Printf("unix socket: '%s' already exists\n", addr)
35 return 1
36 }
37 }
38 g_daemon = new_daemon(*g_sock, addr)
39 if *g_sock == "unix" {
40 // cleanup unix socket file
41 defer os.Remove(addr)
42 }
43
44 rpc.Register(new(RPC))
45
46 g_daemon.loop()
47 return 0
48}
49
50//-------------------------------------------------------------------------
51// daemon

Callers 1

mainFunction · 0.85

Calls 5

get_socket_filenameFunction · 0.85
file_existsFunction · 0.85
new_daemonFunction · 0.85
readMethod · 0.80
loopMethod · 0.80

Tested by

no test coverage detected