Skip to content

Instantly share code, notes, and snippets.

@d3chapma
Created September 1, 2023 19:07
Show Gist options
  • Save d3chapma/01a8748bddb3051e8b8317a8659cef45 to your computer and use it in GitHub Desktop.
Save d3chapma/01a8748bddb3051e8b8317a8659cef45 to your computer and use it in GitHub Desktop.
func (t *TCPServer) handleConnections() error {
var err error
for {
conn, err := t.server.Accept()
if err != nil || conn == nil {
err = errors.New("could not accept connection") // ineffectual assignment
break
}
go t.handleConnection(conn)
}
return err
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment