Skip to content

TCPServer continues to accept connections after stop() #4892

@aleks-f

Description

@aleks-f

Is your feature request related to a problem? Please describe.
Perhaps I'm missing something, but when there are connection attempts after the TCPServer::stop(), the connections continue to be accepted, without a way to prevent those connections to be established and run its course.

Describe the solution you'd like

  • Close the socket on stop, set _stopped to true, and ignore the exceptions in run() after that.
  • add stop() to TCPServerConnectionFactory and allow it to return nullptr, in which case any accepted socket after TCPServer stop will die on their own

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions