[Multiplex] Create ShutdownAll() method to shutdown all the virtual sockets and streams.

PiperOrigin-RevId: 660875041
This commit is contained in:
hai007
2024-08-08 09:55:12 -07:00
committed by Copybara-Service
parent 7c7aa58885
commit 7e4be1131b
5 changed files with 59 additions and 6 deletions
@@ -107,10 +107,11 @@ class MultiplexSocket {
void Shutdown();
bool IsShutdown() { return is_shutdown_; }
void SetShutdown(bool is_shutdown) { is_shutdown_ = is_shutdown; }
void ShutdownAll();
private:
explicit MultiplexSocket(std::shared_ptr<MediumSocket> physical_socket);
~MultiplexSocket() = default;
~MultiplexSocket() { ShutdownAll(); };
// Creates the first virtual socket for the service id. The first virtual
// socket is created by the sender.