home OpenMash Documentations
Class Index Method Index Class Hierarchy

TCL CLASS

ASCP/Client

Abstraction for client side of ASCP protocol. Typically, you create an instance of this class and call "request start" to initiate a service. In some cases, you may want to intercept various stage of the ASCP protocol. To do so, you add various hooks to ASCP/Client so that they will be called when certain events happen. e.g. "on_recv_offer", "on_alive". An ASCP/client object can only launch one service.

SUPERCLASSES

ASCP

SUBCLASSES

IMgrASCP

MEMBERS

precond_, service_, alive_timer_, sev_loc_, request_timer_

precond_

Precondition for the requested service.

service_

A soft-state that remembers we are being served by a service.

alive_timer_

A Mash/Timer object that sends out alive message periodically.

sev_loc_

Service location for the requested service.

request_timer_

A Mash/Timer object that sends out request message periodically.

METHODS

init, destroy, agent_type, service_location, , request, alive, , on_service_expire, on_destroy, on_timeout, on_alive, on_event, timeout, relaunch, , launch_now, launch, precondition, process_packet, service_expire, service_instance, served_by, service_type

init

ASCP/Client public init { spec bw srv_loc precond }

Initialize various members.

bw

maximum bandwidth of the control session

srv_loc

where to find the service.

precondition

precondition which service providers have to pass before launching service.

spec

addr/port specification of the active service control session.

destroy

ASCP/Client instproc destroy { }

Clean-up timers and soft-state.

agent_type

ASCP/Client public agent_type { }

Return the type of this agent: (c)lient/(s)ervice/(m)anager.

service_location

ASCP/Client public service_location { }

Return the service location.

Return the precondition, or set the precondition to the given args.

request

ASCP/Client public request { option args }

"request start" starts the periodic timer that sends a request message. "request stop" stop the timer.

alive

ASCP/Client private alive { option }

"alive start" starts the periodic timer that sends an alive message. "alive stop" stop the timer. "alive pending" checks if a timer exists.

Handle a packet received by the protocol. This method (or methods that it calls) MUST free $packet when done.

on_service_expire

on_destroy

on_timeout

on_alive

ASCP/Client public on_service_expire { option callback }

ASCP/Client public on_destroy { option callback }

ASCP/Client public on_timeout { option callback }

ASCP/Client public on_alive { option callback }

Define callbacks when events happen.

on_event

ASCP/Client private on_event { type option callback }

Private method that manages the callbacks

timeout

ASCP/Client public timeout { }

Call on_timeout callback_, if defined. Default is not to do anything

relaunch

ASCP/Client public relaunch { {option \" \" } }

launch_now

ASCP/Client public launch_now { option args }

"launch start" starts the periodic timer that sends a launch message. "launch stop" stop the timer.

launch

ASCP/Client public launch { option args }

"launch start" starts the periodic timer that sends a launch message. "launch stop" stop the timer.

precondition

ASCP/Client public precondition { args }

process_packet

ASCP/Client public process_packet { addr packet }

service_expire

ASCP/Client public service_expire { }

service_instance

ASCP/Client public service_instance { }

served_by

ASCP/Client public served_by { }

service_type

ASCP/Client public service_type { }

INHERITED METHODS

version, send_announcement, bye, agent_id, args, ssg_port, recv_announcement, del_agent, error, bandwidth, as_args, register, unregister, control_port, add_timer, del_timer, timers, start, stop, announce, recv, timer, get_timer, set_announcement, get_announcement, ttl

INHERITED MEMBERS

lastann_, avgdelta_

FILENAME

tcl/indiva/lib/ascp-client.tcl


Generated on Mon Apr 12 04:04:16 PDT 2004