#include <webtraf.h>
Inheritance diagram for WebTrafSession:


Public Types | |
| enum | TimerStatus { TIMER_IDLE, TIMER_PENDING, TIMER_HANDLING } |
Public Member Functions | |
| WebTrafSession (WebTrafPool *mgr, Node *src, int np, int id, int ftcp_, int recycle_p) | |
| virtual | ~WebTrafSession () |
| RandomVariable *& | interPage () |
| RandomVariable *& | pageSize () |
| RandomVariable *& | interObj () |
| RandomVariable *& | objSize () |
| void | donePage (void *ClntData) |
| void | launchReq (void *ClntData, int obj, int size) |
| int | id () const |
| WebTrafPool * | mgr () |
| void | set_interPageOption (int option) |
| void | sched (double delay) |
| void | resched (double delay) |
| void | cancel () |
| void | force_cancel () |
| int | status () |
Static Public Attributes | |
| int | LASTPAGE_ = 1 |
Protected Attributes | |
| int | status_ |
| Event | event_ |
Private Member Functions | |
| virtual void | expire (Event *e=0) |
| virtual void | handle (Event *e) |
Private Attributes | |
| RandomVariable * | rvInterPage_ |
| RandomVariable * | rvPageSize_ |
| RandomVariable * | rvInterObj_ |
| RandomVariable * | rvObjSize_ |
| WebTrafPool * | mgr_ |
| Node * | src_ |
| int | nPage_ |
| int | curPage_ |
| int | donePage_ |
| int | id_ |
| int | interPageOption_ |
| int | fulltcp_ |
| int | recycle_page_ |
|
|
Definition at line 66 of file timer-handler.h.
00066 { TIMER_IDLE, TIMER_PENDING, TIMER_HANDLING };
|
|
||||||||||||||||||||||||||||
|
Definition at line 117 of file webtraf.cc. References fulltcp_, and recycle_page_.
00117 : 00118 rvInterPage_(NULL), rvPageSize_(NULL), 00119 rvInterObj_(NULL), rvObjSize_(NULL), 00120 mgr_(mgr), src_(src), nPage_(np), curPage_(0), donePage_(0), 00121 id_(id), interPageOption_(1), fulltcp_(0) { 00122 fulltcp_ = ftcp_; 00123 recycle_page_ = recycle_p; 00124 } |
|
|
Definition at line 127 of file webtraf.cc. References abort(), curPage_, donePage_, recycle_page_, rvInterObj_, rvInterPage_, rvObjSize_, rvPageSize_, TimerHandler::status_, and TimerHandler::TIMER_IDLE.
00128 {
00129 if (donePage_ != curPage_) {
00130 fprintf(stderr, "done pages %d != all pages %d\n",
00131 donePage_, curPage_);
00132 abort();
00133 }
00134 if (status_ != TIMER_IDLE) {
00135 fprintf(stderr, "WebTrafSession must be idle when deleted.\n");
00136 abort();
00137 }
00138
00139 // Recycle the objects of page level attributes if needed
00140 // Reuse these objects may save memory for large simulations--xuanc
00141 if (recycle_page_) {
00142 if (rvInterPage_ != NULL)
00143 Tcl::instance().evalf("delete %s", rvInterPage_->name());
00144 if (rvPageSize_ != NULL)
00145 Tcl::instance().evalf("delete %s", rvPageSize_->name());
00146 if (rvInterObj_ != NULL)
00147 Tcl::instance().evalf("delete %s", rvInterObj_->name());
00148 if (rvObjSize_ != NULL)
00149 Tcl::instance().evalf("delete %s", rvObjSize_->name());
00150 }
00151 }
|
Here is the call graph for this function:

|
Here is the call graph for this function:

|
|
Definition at line 153 of file webtraf.cc. References abort(), WebPage::curObj(), WebPage::doneObj(), donePage_, WebTrafPool::doneSession(), WebPage::id(), id_, interPageOption_, WebTrafPool::isdebug(), mgr_, nPage_, rvInterPage_, TimerHandler::sched(), and RandomVariable::value(). Referenced by WebPage::doneObject().
00154 {
00155 WebPage* pg = (WebPage*)ClntData;
00156 if (mgr_->isdebug())
00157 printf("Session %d done page %d\n", id_, pg->id());
00158 if (pg->doneObj() != pg->curObj()) {
00159 fprintf(stderr, "done objects %d != all objects %d\n",
00160 pg->doneObj(), pg->curObj());
00161 abort();
00162 }
00163 delete pg;
00164 // If all pages are done, tell my parent to delete myself
00165 //
00166 if (++donePage_ >= nPage_)
00167 mgr_->doneSession(id_);
00168 else if (interPageOption_) {
00169 // Polly Huang: Wed Nov 21 18:23:30 CET 2001
00170 // add inter-page time option
00171 // inter-page time = end of a page to the start of the next
00172 sched(rvInterPage_->value());
00173 // printf("donePage: %g %d %d\n", Scheduler::instance().clock(), donePage_, curPage_);
00174 }
00175 }
|
Here is the call graph for this function:

|
|
Implements TimerHandler. Definition at line 178 of file webtraf.cc. References curPage_, id_, WebTrafPool::isdebug(), LASTPAGE_, mgr_, WebTrafPool::pickdst(), rvPageSize_, WebPage::start(), and RandomVariable::value().
00179 {
00180 // Pick destination for this page
00181 Node* dst = mgr_->pickdst();
00182 // Make sure page size is not 0!
00183 WebPage* pg = new WebPage(LASTPAGE_++, this,
00184 (int)ceil(rvPageSize_->value()), dst);
00185 if (mgr_->isdebug())
00186 printf("Session %d starting page %d, curpage %d\n",
00187 id_, LASTPAGE_-1, curPage_);
00188 pg->start();
00189 }
|
Here is the call graph for this function:

|
|
Definition at line 60 of file timer-handler.h. References TimerHandler::_cancel(), TimerHandler::status_, TimerHandler::TIMER_IDLE, and TimerHandler::TIMER_PENDING. Referenced by TcpAgent::cancel_rtx_timer(), TcpSessionAgent::cancel_rtx_timer(), TcpFsAgent::cancel_rtx_timer(), AbsTcpAgent::cancel_timer(), TcpAgent::cancel_timers(), TcpSessionAgent::cancel_timers(), FullTcpAgent::cancel_timers(), TcpFsAgent::cancel_timers(), SinkAgent::command(), UnslottedAlohaMac::end_of_contention(), GAFAgent::processDiscoveryMsg(), RTPAgent::rate_change(), TfrcAgent::stop(), RTPAgent::stop(), and SinkAgent::stop().
00060 { // cancel!
00061 if (status_ == TIMER_PENDING) {
00062 _cancel();
00063 status_ = TIMER_IDLE;
00064 }
00065 }
|
Here is the call graph for this function:

|
|
Reimplemented from TimerHandler. Definition at line 191 of file webtraf.cc. References curPage_, TimerHandler::handle(), interPageOption_, nPage_, rvInterPage_, TimerHandler::sched(), and RandomVariable::value().
00192 {
00193 // If I haven't scheduled all my pages, do the next one
00194 TimerHandler::handle(e);
00195 ++curPage_;
00196 // XXX Notice before each page is done, it will schedule itself
00197 // one more time, this makes sure that this session will not be
00198 // deleted after the above call. Thus the following code will not
00199 // be executed in the context of a deleted object.
00200 //
00201 // Polly Huang: Wed Nov 21 18:23:30 CET 2001
00202 // add inter-page time option
00203 // inter-page time = inter-page-start time
00204 // If the interPageOption_ is not set, the XXX Notice above applies.
00205 if (!interPageOption_) {
00206 if (curPage_ < nPage_) {
00207 sched(rvInterPage_->value());
00208 // printf("schedule: %g %d %d\n", Scheduler::instance().clock(), donePage_, curPage_);
00209 }
00210 }
00211 }
|
Here is the call graph for this function:

|
|
Definition at line 66 of file webtraf.h. References id_. Referenced by WebPage::expire().
00066 { return id_; }
|
|
|
Definition at line 61 of file webtraf.h. References rvInterObj_. Referenced by WebTrafPool::command(), and WebPage::handle().
00061 { return rvInterObj_; }
|
|
|
Definition at line 59 of file webtraf.h. References rvInterPage_. Referenced by WebTrafPool::command().
00059 { return rvInterPage_; }
|
|
||||||||||||||||
|
Definition at line 214 of file webtraf.cc. References WebTrafPool::launchReq(), mgr_, and src_. Referenced by WebPage::expire().
|
Here is the call graph for this function:

|
|
Definition at line 67 of file webtraf.h. References mgr_. Referenced by WebPage::expire().
00067 { return mgr_; }
|
|
|
Definition at line 62 of file webtraf.h. References rvObjSize_. Referenced by WebTrafPool::command(), and WebPage::expire().
00062 { return rvObjSize_; }
|
|
|
Definition at line 60 of file webtraf.h. References rvPageSize_. Referenced by WebTrafPool::command().
00060 { return rvPageSize_; }
|
|
Here is the call graph for this function:

|
Here is the call graph for this function:

|
|
Definition at line 68 of file webtraf.h. References interPageOption_. Referenced by WebTrafPool::command().
00068 { interPageOption_ = option; }
|
|
|
|
Definition at line 79 of file webtraf.h. Referenced by expire(), handle(), and ~WebTrafSession(). |
|
|
Definition at line 79 of file webtraf.h. Referenced by donePage(), and ~WebTrafSession(). |
|
|
Definition at line 75 of file timer-handler.h. Referenced by TimerHandler::_cancel(), TimerHandler::_sched(), WebPage::start(), and EmpWebPage::start(). |
|
|
Definition at line 83 of file webtraf.h. Referenced by WebTrafSession(). |
|
|
Definition at line 80 of file webtraf.h. Referenced by donePage(), expire(), and id(). |
|
|
Definition at line 80 of file webtraf.h. Referenced by donePage(), handle(), and set_interPageOption(). |
|
|
Definition at line 114 of file webtraf.cc. Referenced by expire(). |
|
|
Definition at line 77 of file webtraf.h. Referenced by donePage(), expire(), launchReq(), and mgr(). |
|
|
Definition at line 79 of file webtraf.h. Referenced by donePage(), and handle(). |
|
|
Definition at line 85 of file webtraf.h. Referenced by WebTrafSession(), and ~WebTrafSession(). |
|
|
Definition at line 76 of file webtraf.h. Referenced by interObj(), and ~WebTrafSession(). |
|
|
Definition at line 76 of file webtraf.h. Referenced by donePage(), handle(), interPage(), and ~WebTrafSession(). |
|
|
Definition at line 76 of file webtraf.h. Referenced by objSize(), and ~WebTrafSession(). |
|
|
Definition at line 76 of file webtraf.h. Referenced by expire(), pageSize(), and ~WebTrafSession(). |
|
|
Definition at line 78 of file webtraf.h. Referenced by launchReq(). |
|
1.3.3