Manages a single client session, over a TCP socket connection from the
client.
When a client connects to the SPIRO server, the SpiroServer object
creates an instance of this class, and invokes its handle method. See handle.
Note that if a client terminates its connection to the server, the
server will destroy all current connections initiated by that client
Connection is persistent
| Method Summary |
| |
allocId(self)
Allocates a unique id |
| |
dir(self)
List of symbols in interp dict |
| |
do(self,
stmts)
Executes one or more arbitarary statements. |
| |
doimport(self,
modname,
attr)
Performs an import |
| |
executeRequest(self,
req)
Given a request (a dict), does what's needed |
| |
getRequest(self)
Reads a client req - size data - a pickled dict |
| |
handle(self)
Runs the whole client session, receiving commands from the client,
executing them locally, and sending back results as appropriate |
| |
pickleIfPossible(self,
obj)
if object is non-mutable (hashable), try to pickle it and return the
pickle. |
| |
readbytes(self,
n)
Guaranteed read of n bytes from client |
| |
sendCallback(self,
callbackId,
args,
kw)
Send a callback req to the client, and await result |
| |
sendException(self,
exc,
reply,
**kw)
Sends an exception back to client |
| |
sendReply(self,
reply,
**kw)
Sends reply back to client. |
| Inherited from StreamRequestHandler |
| |
finish(self)
|
| |
setup(self)
|
| Inherited from BaseRequestHandler |
| |
__init__(self,
request,
client_address,
server)
|