bug 1005: GetSocket() methods for OnOffApplication and PacketSink

This commit is contained in:
Tom Henderson
2010-10-15 12:53:05 -07:00
parent a150a33b55
commit b892b53ca7
4 changed files with 36 additions and 1 deletions

View File

@@ -111,6 +111,12 @@ OnOffApplication::SetMaxBytes(uint32_t maxBytes)
m_maxBytes = maxBytes;
}
Ptr<Socket>
OnOffApplication::GetSocket (void) const
{
NS_LOG_FUNCTION (this);
return m_socket;
}
void
OnOffApplication::DoDispose (void)

View File

@@ -102,6 +102,11 @@ public:
*/
void SetMaxBytes (uint32_t maxBytes);
/**
* \return pointer to associated socket
*/
Ptr<Socket> GetSocket (void) const;
protected:
virtual void DoDispose (void);
private:

View File

@@ -75,6 +75,20 @@ uint32_t PacketSink::GetTotalRx() const
return m_totalRx;
}
Ptr<Socket>
PacketSink::GetListeningSocket (void) const
{
NS_LOG_FUNCTION (this);
return m_socket;
}
std::list<Ptr<Socket> >
PacketSink::GetAcceptedSockets (void) const
{
NS_LOG_FUNCTION (this);
return m_socketList;
}
void PacketSink::DoDispose (void)
{
NS_LOG_FUNCTION (this);

View File

@@ -77,7 +77,17 @@ public:
* \return the total bytes received in this sink app
*/
uint32_t GetTotalRx () const;
/**
* \return pointer to listening socket
*/
Ptr<Socket> GetListeningSocket (void) const;
/**
* \return list of pointers to accepted sockets
*/
std::list<Ptr<Socket> > GetAcceptedSockets (void) const;
protected:
virtual void DoDispose (void);
private: