| 98 | | def _SocketRecv(self, limit=8192): |
|---|
| 99 | | """Overrides socket access so that stream events can be created.""" |
|---|
| 100 | | result = self.__super._SocketRecv(limit) |
|---|
| 101 | | if self.stream.IncludeRecv and result: self.stream.UpdateObservers(xmlrecv=result) |
|---|
| 102 | | return result |
|---|
| 103 | | |
|---|
| 104 | | def _SocketSend(self, data): |
|---|
| 105 | | """Overrides socket access so that stream events can be created.""" |
|---|
| 106 | | if self.stream.IncludeSend and data: self.stream.UpdateObservers(xmlsend=data) |
|---|
| 107 | | return self.__super._SocketSend(data) |
|---|
| 108 | | |
|---|
| 276 | | |
|---|
| | 258 | #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
|---|
| | 259 | #~ Definitions |
|---|
| | 260 | #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
|---|
| | 261 | |
|---|
| | 262 | class ExtendedClient(Client): |
|---|
| | 263 | def __init__(self, *args, **kw): |
|---|
| | 264 | self.__super.__init__(*args, **kw) |
|---|
| | 265 | self.stream.IncludeSend = kw.get('xmlsend', 0) |
|---|
| | 266 | self.stream.IncludeRecv = kw.get('xmlrecv', 0) |
|---|
| | 267 | self.stream.IncludeTick = kw.get('processtick', 0) |
|---|
| | 268 | |
|---|
| | 269 | def _SocketRecv(self, limit=8192): |
|---|
| | 270 | """Overrides socket access so that stream events can be created.""" |
|---|
| | 271 | result = self.__super._SocketRecv(limit) |
|---|
| | 272 | if self.stream.IncludeRecv and result: self.stream.UpdateObservers(xmlrecv=result) |
|---|
| | 273 | return result |
|---|
| | 274 | |
|---|
| | 275 | def _SocketSend(self, data): |
|---|
| | 276 | """Overrides socket access so that stream events can be created.""" |
|---|
| | 277 | if self.stream.IncludeSend and data: self.stream.UpdateObservers(xmlsend=data) |
|---|
| | 278 | return self.__super._SocketSend(data) |
|---|
| | 279 | |
|---|
| | 280 | def _NeedsRead(self, *args, **kw): |
|---|
| | 281 | """Overrides SmartSelect mechanism to signal stream processtick events.""" |
|---|
| | 282 | result = self.__super._NeedsRead(*args, **kw) |
|---|
| | 283 | if self.stream.IncludeTick and result: self.stream.UpdateObservers(processtick=1) |
|---|
| | 284 | return result |
|---|
| | 285 | |
|---|
| | 286 | #~ Make a super ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
|---|
| | 287 | ExtendedClient._ExtendedClient__super = super(ExtendedClient) |
|---|
| | 288 | |
|---|