add CreateObject<> to instanciate subclasses of the Object base class. Replaces Create<>.
This commit is contained in:
@@ -41,11 +41,11 @@ main (int argc, char *argv[])
|
||||
uint32_t port = 7;
|
||||
|
||||
Ptr<Node> n0 = bus.GetNode (0);
|
||||
Ptr<UdpEchoClient> client = Create<UdpEchoClient> (n0, "10.1.0.1", port,
|
||||
Ptr<UdpEchoClient> client = CreateObject<UdpEchoClient> (n0, "10.1.0.1", port,
|
||||
1, Seconds(1.), 1024);
|
||||
|
||||
Ptr<Node> n1 = bus.GetNode (1);
|
||||
Ptr<UdpEchoServer> server = Create<UdpEchoServer> (n1, port);
|
||||
Ptr<UdpEchoServer> server = CreateObject<UdpEchoServer> (n1, port);
|
||||
|
||||
server->Start(Seconds(1.));
|
||||
client->Start(Seconds(2.));
|
||||
|
||||
Reference in New Issue
Block a user