Log In
New Account
  
 
Home My Page Project Tree Code Snippets Project Openings NUTSS
 
 
Summary Tracker Lists CVS Files
 

CVS | Administration

Diff for /libnutss/examples/slinks_variable_load.c between versions 1.16 and 1.17

version 1.16, 2007/07/02 16:18:27 version 1.17, 2007/07/03 04:24:53
Line 40  void *recvthread(void *arg) {  Line 40  void *recvthread(void *arg) { 
        sleep(1);         sleep(1);
        if(swaplinks_recvfrom(swp, tmp, sizeof(tmp), 0, &peer, &len) > 0) {         if(swaplinks_recvfrom(swp, tmp, sizeof(tmp), 0, &peer, &len) > 0) {
       time++; delta = 0;        time++; delta = 0;
     if(s) fprintf(s,"      %d recvd request %d... load: %d\n",num,time, load);      if(s) fprintf(s,"      %d recvd request %d\n",num,time);
       newflow = (flow_t*)calloc(1,sizeof(flow_t));        newflow = (flow_t*)calloc(1,sizeof(flow_t));
       newflow->duration = atoi(strtok(tmp,";"));        newflow->duration = atoi(strtok(tmp,";"));
       newflow->weight = atoi(strtok(NULL,";"));        newflow->weight = atoi(strtok(NULL,";"));
Line 91  void *recvthread(void *arg) {  Line 91  void *recvthread(void *arg) { 
      newflow->next = flows;       newflow->next = flows;
      if(newflow->next) newflow->next->last = newflow;       if(newflow->next) newflow->next->last = newflow;
      flows = newflow;       flows = newflow;
    if(f)fprintf(f,"%d\n",load);     if(f){
     fprintf(f,"%d\n",load);
 fprintf(s,"        %d accepted flow and recorded load: %d\n",num,load); }
      else  fprintf(s,"ERROR RECORDING LOAD!\n");
       }        }
       // ADMISSION CONTROL        // ADMISSION CONTROL
       // if we're overloaded, drop it if its been pushed too far,        // if we're overloaded, drop it if its been pushed too far,
       // or pass on to a neighbor and mark it as such if not        // or pass on to a neighbor and mark it as such if not
       else if(exts < 5) {        else if(exts < 5) {
        fprintf(s,"        %d rejected flow, load too high: %d >= %d\n",num,load,maxload);
      swaplinks_update_walk_length(swp,1);       swaplinks_update_walk_length(swp,1);
      snprintf(msg,64,"%d;%d;%d;",newflow->duration,newflow->weight,exts+1);       snprintf(msg,64,"%d;%d;%d;",newflow->duration,newflow->weight,exts+1);
      swaplinks_sendtoany(swp,msg,strlen(msg)+1,0);       swaplinks_sendtoany(swp,msg,strlen(msg)+1,0);

Removed from v.1.16  
changed lines
  Added in v.1.17


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>
 

GForge.cis.cornell.edu is brought to you by

Cornell Computing and Information Science


Powered By GForge Collaborative Development Environment