equal
deleted
inserted
replaced
20 * Mathieu Lacage <mathieu.lacage@sophia.inria.fr> |
20 * Mathieu Lacage <mathieu.lacage@sophia.inria.fr> |
21 */ |
21 */ |
22 |
22 |
23 #include "ns3/log.h" |
23 #include "ns3/log.h" |
24 #include "ns3/packet.h" |
24 #include "ns3/packet.h" |
|
25 #include "node.h" |
25 #include "socket.h" |
26 #include "socket.h" |
|
27 #include "socket-factory.h" |
26 |
28 |
27 NS_LOG_COMPONENT_DEFINE ("Socket"); |
29 NS_LOG_COMPONENT_DEFINE ("Socket"); |
28 |
30 |
29 namespace ns3 { |
31 namespace ns3 { |
30 |
32 |
81 Socket::~Socket () |
83 Socket::~Socket () |
82 { |
84 { |
83 NS_LOG_FUNCTION_NOARGS (); |
85 NS_LOG_FUNCTION_NOARGS (); |
84 } |
86 } |
85 |
87 |
|
88 Ptr<Socket> |
|
89 Socket::CreateSocket (Ptr<Node> node, TypeId tid) |
|
90 { |
|
91 Ptr<Socket> s; |
|
92 Ptr<SocketFactory> socketFactory = node->GetObject<SocketFactory> (tid); |
|
93 s = socketFactory->CreateSocket (); |
|
94 NS_ASSERT (s != 0); |
|
95 return s; |
|
96 } |
|
97 |
86 void |
98 void |
87 Socket::SetCloseCallback (Callback<void,Ptr<Socket> > closeCompleted) |
99 Socket::SetCloseCallback (Callback<void,Ptr<Socket> > closeCompleted) |
88 { |
100 { |
89 NS_LOG_FUNCTION_NOARGS (); |
101 NS_LOG_FUNCTION_NOARGS (); |
90 m_closeCompleted = closeCompleted; |
102 m_closeCompleted = closeCompleted; |