func (s *Server) handleOnNewSocketConnection(bs backend.BackendSocket) { // Close the socket if incomming connections should be blocked. if s.IsBlocked() { bs.Close() return } // Create a new socket value. // The goroutines are started automatically. newSocket(s, bs) }
func onNewSocketConnection(bs backend.BackendSocket) { // Close the socket if incomming connections should be blocked. if block { bs.Close() return } // Create a new socket value. // The goroutines are started automatically. newSocket(bs) }
func onNewSocketConnection(bs backend.BackendSocket) { // Close the socket if incomming connections should be blocked. if block { bs.Close() return } // Create a new socket value. s := newSocket(bs) func() { // Recover panics and log the error. defer func() { if e := recover(); e != nil { log.L.Errorf("glue: panic while calling on new socket function: %v\n%s", e, debug.Stack()) } }() // Trigger the on new socket event function. onNewSocket(s) }() }