Package ganeti :: Package rpc :: Module transport :: Class FdTransport
[hide private]
[frames] | no frames]

Class FdTransport

source code

Low-level transport class that works on arbitrary file descriptors.

Unlike Transport, this doesn't use timeouts.

Instance Methods [hide private]
 
__init__(self, fds, timeouts=None, allow_non_master=None)
Constructor for the Client class.
source code
 
_CheckSocket(self)
Make sure we are connected.
source code
 
Send(self, msg)
Send a message.
source code
 
Recv(self)
Try to receive a message from the read part of the socket.
source code
 
Call(self, msg)
Send a message and wait for the response.
source code
 
Close(self)
Close the socket
source code
 
close(self) source code
Method Details [hide private]

__init__(self, fds, timeouts=None, allow_non_master=None)
(Constructor)

source code 

Constructor for the Client class.

Parameters:
  • fds (pair of file descriptors) - the file descriptor for reading (the first in the pair) and the file descriptor for writing (the second)
  • timeouts (int) - unused
  • allow_non_master (bool) - unused

Send(self, msg)

source code 

Send a message.

This just sends a message and doesn't wait for the response.

Recv(self)

source code 

Try to receive a message from the read part of the socket.

In case we already have messages queued, we just return from the queue.

Call(self, msg)

source code 

Send a message and wait for the response.

This is just a wrapper over Send and Recv.