build, cmd/stdiscosrv, cmd/strelaysrv: Rename binaries to add "st" prefix

GitHub-Pull-Request: https://github.com/syncthing/syncthing/pull/3371
This commit is contained in:
aviau
2016-07-04 10:51:22 +00:00
committed by Jakob Borg
parent aa50ef4069
commit 6ff74cfcab
21 changed files with 53 additions and 53 deletions

28
cmd/strelaysrv/utils.go Normal file
View File

@@ -0,0 +1,28 @@
// Copyright (C) 2015 Audrius Butkevicius and Contributors.
package main
import (
"errors"
"net"
)
func setTCPOptions(conn net.Conn) error {
tcpConn, ok := conn.(*net.TCPConn)
if !ok {
return errors.New("Not a TCP connection")
}
if err := tcpConn.SetLinger(0); err != nil {
return err
}
if err := tcpConn.SetNoDelay(true); err != nil {
return err
}
if err := tcpConn.SetKeepAlivePeriod(networkTimeout); err != nil {
return err
}
if err := tcpConn.SetKeepAlive(true); err != nil {
return err
}
return nil
}