MCPcopy
hub / github.com/txthinking/brook / NewServer

Function NewServer

server.go:33–45  ·  view source on GitHub ↗
(addr, password string, tcpTimeout, udpTimeout int)

Source from the content-addressed store, hash-verified

31}
32
33func NewServer(addr, password string, tcpTimeout, udpTimeout int) (*Server, error) {
34 if err := limits.Raise(); err != nil {
35 Log(Error{"when": "try to raise system limits", "warning": err.Error()})
36 }
37 s := &Server{
38 Password: []byte(password),
39 Addr: addr,
40 TCPTimeout: tcpTimeout,
41 UDPTimeout: udpTimeout,
42 RunnerGroup: runnergroup.New(),
43 }
44 return s, nil
45}
46
47func (s *Server) ListenAndServe() error {
48 addr, err := net.ResolveTCPAddr("tcp", s.Addr)

Callers 1

mainFunction · 0.92

Calls 2

RaiseFunction · 0.92
ErrorMethod · 0.80

Tested by

no test coverage detected