examples/tcp-large-transfer.cc
changeset 3243 a4b8da16a324
parent 3242 309f511aa143
parent 3132 b0b0abb911cd
child 3245 ad57fb768f3a
equal deleted inserted replaced
3242:309f511aa143 3243:a4b8da16a324
   141 
   141 
   142   int nBytes = 2000000;
   142   int nBytes = 2000000;
   143   uint16_t servPort = 50000;
   143   uint16_t servPort = 50000;
   144 
   144 
   145   // Create a packet sink to receive these packets
   145   // Create a packet sink to receive these packets
   146   PacketSinkHelper sink ("ns3::Tcp",
   146   PacketSinkHelper sink ("ns3::TcpSocketFactory",
   147                          InetSocketAddress (Ipv4Address::GetAny (), servPort));
   147                          InetSocketAddress (Ipv4Address::GetAny (), servPort));
   148 
   148 
   149   ApplicationContainer apps = sink.Install (c1.Get (1));
   149   ApplicationContainer apps = sink.Install (c1.Get (1));
   150   apps.Start (Seconds (0.0));
   150   apps.Start (Seconds (0.0));
   151 
   151 
   152   // and generate traffic to remote sink.
   152   // and generate traffic to remote sink.
   153   //TypeId tid = TypeId::LookupByName ("ns3::Tcp");
   153   //TypeId tid = TypeId::LookupByName ("ns3::TcpSocketFactory");
   154   Ptr<Socket> localSocket = Socket::CreateSocket (c0.Get (0), Tcp::GetTypeId ());
   154   Ptr<Socket> localSocket = Socket::CreateSocket (c0.Get (0), TcpSocketFactory::GetTypeId ());
   155   localSocket->Bind ();
   155   localSocket->Bind ();
   156   Simulator::ScheduleNow (&StartFlow, localSocket, nBytes,
   156   Simulator::ScheduleNow (&StartFlow, localSocket, nBytes,
   157                           ipInterfs.GetAddress (1), servPort);
   157                           ipInterfs.GetAddress (1), servPort);
   158 
   158 
   159   Config::ConnectWithoutContext ("/NodeList/*/ApplicationList/*/Rx", 
   159   Config::ConnectWithoutContext ("/NodeList/*/ApplicationList/*/Rx",