예제 #1
0
func NewServer() *Server {
	return &Server{
		exitCh:        make(chan bool),
		waitGroup:     &sync.WaitGroup{},
		funcMap:       funcmap.NewFuncMap(),
		acceptTimeout: 60,
		readTimeout:   60,
		writeTimeout:  60,
		maxPacLen:     2048,
	}
}
예제 #2
0
func NewServer() *Server {
	return &Server{
		exitCh:        make(chan bool),
		waitGroup:     &sync.WaitGroup{},
		funcMap:       funcmap.NewFuncMap(),
		acceptTimeout: 30,
		readTimeout:   60,
		writeTimeout:  60,
		reqMemPool: &sync.Pool{
			New: func() interface{} {
				return make([]byte, 1024)
			},
		},
		rbufMemPool: &sync.Pool{
			New: func() interface{} {
				return ringbuffer.NewRingBuffer(1024)
			},
		},
	}
}