func (s *Server) Addr() string {
	if s.Listener != nil {
		return s.Listener.Addr().String()
	}
	return ""
}
Address this server is listening at
package gotalk
import (
	"crypto/tls"
	"net"
	"os"
	"os/signal"
	"syscall"
	"time"
)
type SockHandler func(*Sock)
type Server struct {
	*Handlers
	*Limits
	AcceptHandler SockHandler
	HeartbeatInterval time.Duration
	OnHeartbeat func(load int, t time.Time)
	Listener net.Listener
}
func NewServer(h *Handlers, limits *Limits, l net.Listener) *Server {
	return &Server{Handlers: h, Limits: limits, Listener: l}
}
func Listen(how, addr string) (*Server, error) {
	l, err := net.Listen(how, addr)
	if err != nil {
		return nil, err
	}
	l = wrapListener(l)
	s := NewServer(DefaultHandlers, DefaultLimits, l)
	return s, nil
}
func ListenTLS(how, addr string, certFile, keyFile string) (*Server, error) {
	cert, err := tls.LoadX509KeyPair(certFile, keyFile)
	if err != nil {
		return nil, err
	}
	return ListenTLSCustom(how, addr, &tls.Config{
		RootCAs:      TLSCertPool(),
		Certificates: []tls.Certificate{cert},
	})
}
func ListenTLSCustom(how, addr string, config *tls.Config) (*Server, error) {
	l, err := net.Listen(how, addr)
	if err != nil {
		return nil, err
	}
	l = tls.NewListener(wrapListener(l), config)
	s := NewServer(DefaultHandlers, DefaultLimits, l)
	return s, nil
}
func (s *Server) EnableUnixSocketGC() {
	if _, ok := s.Listener.(*net.UnixListener); ok {
		sigc := make(chan os.Signal, 1)
		signal.Notify(sigc, os.Interrupt, os.Kill, syscall.SIGTERM)
		go func(c chan os.Signal) {
			<-c        
			s.Close()  
			os.Exit(0)
		}(sigc)
	}
}
func Serve(how, addr string, acceptHandler SockHandler) error {
	s, err := Listen(how, addr)
	if err != nil {
		return err
	}
	s.AcceptHandler = acceptHandler
	return s.Accept()
}
func (s *Server) Accept() error {
	var tempDelay time.Duration  
	for {
		c, e := s.Listener.Accept()
		if e != nil {
			if ne, ok := e.(net.Error); ok && ne.Temporary() {
				if tempDelay == 0 {
					tempDelay = 5 * time.Millisecond
				} else {
					tempDelay *= 2
				}
				if max := 1 * time.Second; tempDelay > max {
					tempDelay = max
				}
				time.Sleep(tempDelay)
				continue
			}
			return e
		}
		go s.accept(c)
	}
}
func (s *Server) accept(c net.Conn) {
	s2 := NewSock(s.Handlers)
	s2.Adopt(c)
	if err := s2.Handshake(); err == nil {
		if s.AcceptHandler != nil {
			s.AcceptHandler(s2)
		}
		s2.HeartbeatInterval = s.HeartbeatInterval
		s2.OnHeartbeat = s.OnHeartbeat
		s2.Read(s.Limits)
	}
}