MySocket *mysocket = new MySocket();
mysocket->totalBytes = totalBytes;
mysocket->remaining = totalBytes;
- mysocket->last_amount_sent = 0;
mysocket->bufferedBytes = 0;
mysocket->sentBytes = 0;
mysocket->finished = 0;
return ((MySocket *)socket)->sentBytes;
}
-double NS3Sim::get_last_amount_sent_from_socket(void *socket){
- return ((MySocket *)socket)->last_amount_sent;
-}
-
-void NS3Sim::reset_last_amount_sent_from_socket(void *socket){
- ((MySocket *)socket)->last_amount_sent = 0;
-}
-
void NS3Sim::simulator_stop(double min){
if(min > 0.0)
Simulator::Stop(Seconds(min));
if(amountSent < 0)
return;
- (mysocket->last_amount_sent) += amountSent;
(mysocket->bufferedBytes) += amountSent;
(mysocket->remaining) -= amountSent;
//cout << "[" << Simulator::Now ().GetSeconds() << "] " << "Send one packet, remaining "<< mysocket->remaining << " bytes!" << endl;