OLD | NEW |
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ | 1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ |
2 /* | 2 /* |
3 * This program is free software; you can redistribute it and/or modify | 3 * This program is free software; you can redistribute it and/or modify |
4 * it under the terms of the GNU General Public License version 2 as | 4 * it under the terms of the GNU General Public License version 2 as |
5 * published by the Free Software Foundation; | 5 * published by the Free Software Foundation; |
6 * | 6 * |
7 * This program is distributed in the hope that it will be useful, | 7 * This program is distributed in the hope that it will be useful, |
8 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 8 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
9 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 9 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
10 * GNU General Public License for more details. | 10 * GNU General Public License for more details. |
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
161 Simulator::ScheduleNow (&StartFlow, localSocket, | 161 Simulator::ScheduleNow (&StartFlow, localSocket, |
162 ipInterfs.GetAddress (1), servPort); | 162 ipInterfs.GetAddress (1), servPort); |
163 | 163 |
164 // One can toggle the comment for the following line on or off to see the | 164 // One can toggle the comment for the following line on or off to see the |
165 // effects of finite send buffer modelling. One can also change the size of | 165 // effects of finite send buffer modelling. One can also change the size of |
166 // said buffer. | 166 // said buffer. |
167 | 167 |
168 //localSocket->SetAttribute("SndBufSize", UintegerValue(4096)); | 168 //localSocket->SetAttribute("SndBufSize", UintegerValue(4096)); |
169 | 169 |
170 //Ask for ASCII and pcap traces of network traffic | 170 //Ask for ASCII and pcap traces of network traffic |
171 std::ofstream ascii; | 171 AsciiTraceHelper ascii; |
172 ascii.open ("tcp-large-transfer.tr"); | 172 p2p.EnableAsciiAll (ascii.CreateFileStream ("tcp-large-transfer.tr")); |
173 PointToPointHelper::EnableAsciiAll (ascii); | 173 p2p.EnablePcapAll ("tcp-large-transfer"); |
174 PointToPointHelper::EnablePcapAll ("tcp-large-transfer"); | |
175 | 174 |
176 // Finally, set up the simulator to run. The 1000 second hard limit is a | 175 // Finally, set up the simulator to run. The 1000 second hard limit is a |
177 // failsafe in case some change above causes the simulation to never end | 176 // failsafe in case some change above causes the simulation to never end |
178 Simulator::Stop (Seconds(1000)); | 177 Simulator::Stop (Seconds(1000)); |
179 Simulator::Run (); | 178 Simulator::Run (); |
180 Simulator::Destroy (); | 179 Simulator::Destroy (); |
181 } | 180 } |
182 | 181 |
183 | 182 |
184 //----------------------------------------------------------------------------- | 183 //----------------------------------------------------------------------------- |
(...skipping 25 matching lines...) Expand all Loading... |
210 int amountSent = localSocket->Send (&data[dataOffset], toWrite, 0); | 209 int amountSent = localSocket->Send (&data[dataOffset], toWrite, 0); |
211 if(amountSent < 0) | 210 if(amountSent < 0) |
212 { | 211 { |
213 // we will be called again when new tx space becomes available. | 212 // we will be called again when new tx space becomes available. |
214 return; | 213 return; |
215 } | 214 } |
216 currentTxBytes += amountSent; | 215 currentTxBytes += amountSent; |
217 } | 216 } |
218 localSocket->Close (); | 217 localSocket->Close (); |
219 } | 218 } |
OLD | NEW |