Changeset 649:5e5d8152c229 in freeDiameter for doc
- Timestamp:
- Jan 5, 2011, 5:13:34 PM (13 years ago)
- Branch:
- default
- Phase:
- public
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
doc/dbg_interactive.py.sample
r641 r649 464 464 mydwr.send() 465 465 466 # Optionaly, a callback can be registered when a messageis sent, with an optional object.466 # Optionaly, a callback can be registered when a request is sent, with an optional object. 467 467 # This callback takes the answer message as parameter and should return None or a message. (cf. fd_msg_send) 468 468 def send_callback(msg, obj): … … 475 475 mydwr = msg(buf) 476 476 mydwr.send(send_callback, some_object) 477 478 # Again optionaly, a time limit can be specified in this case as follow: 479 mydwr.send(send_callback, some_object, 10) 480 # In that case, if no answer / error is received after 10 seconds (the value specified), 481 # the callback is called with the request as parameter. 482 # Testing for timeout case is done by using msg.is_request() 483 def send_callback(msg, obj): 484 if (msg.is_request()): 485 print "Request timed out without answer:" 486 else: 487 print "Received answer:" 488 msg.dump() 489 print "Associated data:" 490 obj 491 return None 477 492 478 493
Note: See TracChangeset
for help on using the changeset viewer.