test/channel_transport/udp_socket_manager_unittest.cc
TEST(UdpSocketManager, UnremovedSocketsGetCollectedAtManagerDeletion) {
#if defined(_WIN32)
  // It's hard to test an infinite wait, so we don't.
#else
  int32_t id = 42;
  uint8_t threads = 1;
  UdpSocketManager* mgr = UdpSocketManager::Create(id, threads);
  UdpSocketWrapper* unused_socket = UdpSocketWrapper::CreateSocket(
      id,
      mgr,
      NULL,  // CallbackObj
      NULL,  // IncomingSocketCallback
      false,  // ipV6Enable
      false);  // disableGQOS
  // The constructor will do AddSocket on the manager.
  // Call a member funtion to work around "set but not used" compliation
  // error on ChromeOS ARM.
  unused_socket->SetEventToNull();
  unused_socket = NULL;
  UdpSocketManager::Return();
#endif
}
// Creates a socket and add it to the socket manager, but does not remove it
// before destroying the socket manager.
// On Posix, this destroys the socket.
// On Winsock2 Windows, it enters an infinite wait for all the sockets
// to go away.
Creates a socket and add it to the socket manager, but does not remove it
before destroying the socket manager.
On Posix, this destroys the socket.
On Winsock2 Windows, it enters an infinite wait for all the sockets
to go away.
Creates a socket and add it to the socket manager but does not remove it before destroying the socket manager . On Posix this destroys the socket . On Winsock2 Windows it enters an infinite wait for all the sockets to go away .
TEST(UdpSocketManager, UnremovedSocketsGetCollectedAtManagerDeletion) {
#if defined(_WIN32)
#else
  int32_t id = 42;
  uint8_t threads = 1;
  UdpSocketManager* mgr = UdpSocketManager::Create(id, threads);
  UdpSocketWrapper* unused_socket = UdpSocketWrapper::CreateSocket(
      id,
      mgr,
      NULL,  
      NULL,  
      false,  
      false);  
  unused_socket->SetEventToNull();
  unused_socket = NULL;
  UdpSocketManager::Return();
#endif
}
TEST ( UdpSocketManager , UnremovedSocketsGetCollectedAtManagerDeletion ) { #if defined ( _WIN32 ) #else int32_t id = 42 ; uint8_t threads = 1 ; UdpSocketManager * mgr = UdpSocketManager :: Create ( id , threads ) ; UdpSocketWrapper * unused_socket = UdpSocketWrapper :: CreateSocket ( id , mgr , NULL , NULL , false , false ) ; unused_socket -> SetEventToNull ( ) ; unused_socket = NULL ; UdpSocketManager :: Return ( ) ; #endif }
Creates a socket and add it to the socket manager, but does not remove it
before destroying the socket manager.
Creates a socket and add it to the socket manager but does not remove it before destroying the socket manager .
// It's hard to test an infinite wait, so we don't. // CallbackObj // IncomingSocketCallback // ipV6Enable // disableGQOS // The constructor will do AddSocket on the manager. // Call a member funtion to work around "set but not used" compliation // error on ChromeOS ARM.