|
|
| 205 |
Ipv4InterfaceContainer i = ipv4.Assign (devices); |
205 |
Ipv4InterfaceContainer i = ipv4.Assign (devices); |
| 206 |
|
206 |
|
| 207 |
TypeId tid = TypeId::LookupByName ("ns3::UdpSocketFactory"); |
207 |
TypeId tid = TypeId::LookupByName ("ns3::UdpSocketFactory"); |
| 208 |
Ptr<Socket> recvSink = Socket::CreateSocket (c.Get (0), tid); |
208 |
Ptr<Socket> recvSink = Socket::CreateSocket (c.Get (sinkNode), tid); |
| 209 |
InetSocketAddress local = InetSocketAddress (Ipv4Address::GetAny (), 80); |
209 |
InetSocketAddress local = InetSocketAddress (Ipv4Address::GetAny (), 80); |
| 210 |
recvSink->Bind (local); |
210 |
recvSink->Bind (local); |
| 211 |
recvSink->SetRecvCallback (MakeCallback (&ReceivePacket)); |
211 |
recvSink->SetRecvCallback (MakeCallback (&ReceivePacket)); |