func NewServerSize(addr string, decoder Decoder, encoder Encoder, readBufSize, writeBufSize int, generator IDGenerator) *Server {
	s := &Server{
		addr:        addr,
		sessionMaps: make(map[int]*sessionMap, DefaultSessionBucketSize),
		decoder:      decoder,
		encoder:      encoder,
		readBufSize:  readBufSize,
		writeBufSize: writeBufSize,
		generator: generator,
		stopOnce: &sync.Once{},
		startCh:  make(chan struct{}, 1),
	}
	for i := 0; i < DefaultSessionBucketSize; i++ {
		s.sessionMaps[i] = &sessionMap{
			sessions: make(map[interface{}]IOSession),
		}
	}
	return s
}
NewServerSize create server
package goetty
import (
	"net"
	"sync"
	"sync/atomic"
	"time"
)
type Closer interface {
	Close() error
}
type MessageWriter interface {
	Write(msg interface{}) error
}
type MessageReader interface {
	Read() (interface{}, error)
	ReadTimeout(timeout time.Duration) (interface{}, error)
}
type IDGenerator interface {
	NewID() interface{}
}
type Int64IDGenerator struct {
	counter int64
}
func NewInt64IDGenerator() IDGenerator {
	return &Int64IDGenerator{}
}
func (g *Int64IDGenerator) NewID() interface{} {
	return atomic.AddInt64(&g.counter, 1)
}
type UUIDV4IdGenerator struct {
}
func (g *UUIDV4IdGenerator) NewID() interface{} {
	return NewV4UUID()
}
func NewUUIDV4IdGenerator() IDGenerator {
	return &UUIDV4IdGenerator{}
}
type sessionMap struct {
	sync.RWMutex
	sessions map[interface{}]IOSession
}
const DefaultSessionBucketSize = 64
type Server struct {
	addr     string
	listener *net.TCPListener
	sessionMaps map[int]*sessionMap
	readBufSize, writeBufSize int
	decoder Decoder
	encoder Encoder
	generator IDGenerator
	startCh  chan struct{}
	stopOnce *sync.Once
	stopped  bool
}
func NewServer(addr string, decoder Decoder, encoder Encoder, generator IDGenerator) *Server {
	return NewServerSize(addr, decoder, encoder, BufReadSize, BufWriteSize, generator)
}