Package ganeti :: Package cmdlib :: Module test :: Class TestSocketWrapper
[hide private]
[frames] | no frames]

Class TestSocketWrapper

source code


Utility class that opens a domain socket and cleans up as needed.

Instance Methods [hide private]
 
__init__(self)
Constructor cleaning up variables to be used.
source code
tuple of socket, string
Create(self, max_connections=1)
Creates a bound and ready socket, cleaning up in case of failure.
source code
 
Destroy(self)
Destroys the socket and performs all necessary cleanup.
source code

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self)
(Constructor)

source code 

Constructor cleaning up variables to be used.

Overrides: object.__init__

Create(self, max_connections=1)

source code 

Creates a bound and ready socket, cleaning up in case of failure.

Parameters:
  • max_connections (int) - The number of max connections allowed for the socket.
Returns: tuple of socket, string
The socket object and the path to reach it with.