| |
- Agent
- Manager
class Agent |
|
Network client: receive requests, send back responses |
|
Methods defined here:
- __init__(self, (cbFun, cbCtx)=(None, None), ifaces=[('0.0.0.0', 161)])
- __repr__(self)
- __str__(self)
- close(self)
- close()
Close UDP socket used for communication with client.
- get_socket(self)
- get_socket() -> socket
Return socket object previously created with open() method.
- open(self)
- open()
Initialize transport internals to be used for further
communication with client.
- read(self)
- read() -> (req, src)
Read data from the socket (assuming there's some data ready
for reading), return a tuple of request (as string) and
source address 'src' (in socket module notation).
- receive(self)
- receive() -> (req, src)
Wait for and receive request message from remote process
or timeout.
Return a tuple of request message (as string) and source address
'src' (in socket module notation).
- receiveAndSend(self, (cbFun, cbCtx)=(None, None))
- receive_and_send((cbFun, cbCtx))
Wait for request from a client process or timeout (and raise
IdleTimeoutError exception), pass request to the callback function
to build a response, send response back to client process.
- receive_and_send = receiveAndSend(self, (cbFun, cbCtx)=(None, None))
- send(self, message, dst)
- send(rsp, dst)
Send response message (given as string) to client process
by 'dst' address given in socket module notation.
|
class Manager |
|
Network client: send data item to server and receive a response |
|
Methods defined here:
- __init__(self, agent=(None, 0), iface=('0.0.0.0', 0))
- __repr__(self)
- __str__(self)
- close(self)
- close()
Terminate communication with remote server.
- getSocket(self)
- get_socket() -> socket
Return socket object previously created with open() method.
- get_socket = getSocket(self)
- open(self)
- open()
Initialize transport layer (UDP socket) to be used
for further communication with server.
- read(self)
- read() -> (message, src)
Read data from the socket (assuming there's some data ready
for reading), return a tuple of response message (as string)
and source address 'src' (in socket module notation).
- receive(self)
- receive() -> (message, src)
Wait for incoming data from network or timeout (and return
a tuple of None's).
Return a tuple of received data item (as string) and source address
'src' (in socket module notation).
- send(self, request, dst=(None, 0))
- send(req[, dst])
Send "req" message (string) to server by address specified on
object creation or by "dst" address given in socket module
notation.
- sendAndReceive(self, message, dst=(None, 0), cbFun=None)
- sendAndEeceive(data[, dst, [(cbFun, cbCtx)]]) -> (data, src)
Send data item to remote entity by address specified on object
creation or 'dst' address and receive a data item in response
or timeout (and raise NoResponse exception).
Return a tuple of data item (as string) and source address
'src' (in socket module notation).
- send_and_receive = sendAndReceive(self, message, dst=(None, 0), cbFun=None)
|
agent = class Agent |
|
Network client: receive requests, send back responses |
|
Methods defined here:
- __init__(self, (cbFun, cbCtx)=(None, None), ifaces=[('0.0.0.0', 161)])
- __repr__(self)
- __str__(self)
- close(self)
- close()
Close UDP socket used for communication with client.
- get_socket(self)
- get_socket() -> socket
Return socket object previously created with open() method.
- open(self)
- open()
Initialize transport internals to be used for further
communication with client.
- read(self)
- read() -> (req, src)
Read data from the socket (assuming there's some data ready
for reading), return a tuple of request (as string) and
source address 'src' (in socket module notation).
- receive(self)
- receive() -> (req, src)
Wait for and receive request message from remote process
or timeout.
Return a tuple of request message (as string) and source address
'src' (in socket module notation).
- receiveAndSend(self, (cbFun, cbCtx)=(None, None))
- receive_and_send((cbFun, cbCtx))
Wait for request from a client process or timeout (and raise
IdleTimeoutError exception), pass request to the callback function
to build a response, send response back to client process.
- receive_and_send = receiveAndSend(self, (cbFun, cbCtx)=(None, None))
- send(self, message, dst)
- send(rsp, dst)
Send response message (given as string) to client process
by 'dst' address given in socket module notation.
|
manager = class Manager |
|
Network client: send data item to server and receive a response |
|
Methods defined here:
- __init__(self, agent=(None, 0), iface=('0.0.0.0', 0))
- __repr__(self)
- __str__(self)
- close(self)
- close()
Terminate communication with remote server.
- getSocket(self)
- get_socket() -> socket
Return socket object previously created with open() method.
- get_socket = getSocket(self)
- open(self)
- open()
Initialize transport layer (UDP socket) to be used
for further communication with server.
- read(self)
- read() -> (message, src)
Read data from the socket (assuming there's some data ready
for reading), return a tuple of response message (as string)
and source address 'src' (in socket module notation).
- receive(self)
- receive() -> (message, src)
Wait for incoming data from network or timeout (and return
a tuple of None's).
Return a tuple of received data item (as string) and source address
'src' (in socket module notation).
- send(self, request, dst=(None, 0))
- send(req[, dst])
Send "req" message (string) to server by address specified on
object creation or by "dst" address given in socket module
notation.
- sendAndReceive(self, message, dst=(None, 0), cbFun=None)
- sendAndEeceive(data[, dst, [(cbFun, cbCtx)]]) -> (data, src)
Send data item to remote entity by address specified on object
creation or 'dst' address and receive a data item in response
or timeout (and raise NoResponse exception).
Return a tuple of data item (as string) and source address
'src' (in socket module notation).
- send_and_receive = sendAndReceive(self, message, dst=(None, 0), cbFun=None)
| |