Skip to content

If listener.Accept returns an error then the server stops responding #21

Open
@stefanba3

Description

@stefanba3

For example, here:

func (s *server) run() {
	defer s.wg.Done()
	for {
		client, err := s.netListener.Accept()
		if err != nil {
			break
		}

		s.handle(client)
	}
}

netListener is commonly a TLS listener, which can return an error from Accept for many reasons. Breaking out of the loop stops the server from accepting new connections. And, as far as I can tell, there is no way to know from the outside (since run gets called in a goroutine) that this has happened.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions