Navigation


Changeset 649:5e5d8152c229 in freeDiameter for doc


Ignore:
Timestamp:
Jan 5, 2011, 5:13:34 PM (13 years ago)
Author:
Sebastien Decugis <sdecugis@nict.go.jp>
Branch:
default
Phase:
public
Message:

Implemented fd_msg_send_timeout to close #10. Not tested yet.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • doc/dbg_interactive.py.sample

    r641 r649  
    464464mydwr.send()
    465465
    466 # Optionaly, a callback can be registered when a message is sent, with an optional object.
     466# Optionaly, a callback can be registered when a request is sent, with an optional object.
    467467# This callback takes the answer message as parameter and should return None or a message. (cf. fd_msg_send)
    468468def send_callback(msg, obj):
     
    475475mydwr = msg(buf)
    476476mydwr.send(send_callback, some_object)
     477
     478# Again optionaly, a time limit can be specified in this case as follow:
     479mydwr.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()
     483def 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
    477492
    478493
Note: See TracChangeset for help on using the changeset viewer.