bug 1005: GetSocket() methods for OnOffApplication and PacketSink
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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:
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user