Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrCancelled = errors.New("cancelled")
)
Functions ¶
This section is empty.
Types ¶
type ConnectionHandler ¶
ConnectionHandler is the signature of the handler function Returning an error in the handler exits the ListerAndServe function with that error
type TCPServer ¶
type TCPServer struct {
// contains filtered or unexported fields
}
TCPServer holds the data for our TCP Server
func (*TCPServer) GetNbAccepted ¶
GetNbAccepted returns the number of connections accepted
func (*TCPServer) GetNbGoroutines ¶
GetNbGoroutines returns the number of goroutines currently handling connections
func (*TCPServer) ListerAndServe ¶
func (tcpServer *TCPServer) ListerAndServe(ctx context.Context, address string, handler ConnectionHandler, tlsConfig *tls.Config, userData interface{}) error
ListerAndServe accepts incoming tcp connexions and calls the handler in a new goroutine
Click to show internal directories.
Click to hide internal directories.