bug 203: Listen must be implemented for Udp and Packet sockets.

This commit is contained in:
Mathieu Lacage committed 2008-06-04 09:19:16 -07:00
1 parent 8b7d6955e6
commit 92f2ed110a
6 files changed
+19 -8

No files matched your search

+6
View File
@@ -220,6 +220,12 @@ PacketSocket::Connect(const Address &ad)
NotifyConnectionFailed ();
return -1;
}
int
PacketSocket::Listen(uint32_t queueLimit)
{
m_errno = Socket::ERROR_OPNOTSUPP;
return -1;
}
int
PacketSocket::Send (Ptr<Packet> p)
+3
View File
@@ -71,6 +71,8 @@ class PacketSocketAddress;
* The fields "physical address", device, and protocol are filled.
*
* - Accept: not allowed
*
* - Listen: returns -1 (OPNOTSUPP)
*/
class PacketSocket : public Socket
{
@@ -90,6 +92,7 @@ public:
virtual int ShutdownSend (void);
virtual int ShutdownRecv (void);
virtual int Connect(const Address &address);
virtual int Listen(uint32_t queueLimit);
virtual int Send (Ptr<Packet> p);
virtual uint32_t GetTxAvailable (void) const;
-6
View File
@@ -103,12 +103,6 @@ Socket::SetRecvCallback (Callback<void, Ptr<Socket> > receivedData)
m_receivedData = receivedData;
}
int Socket::Listen (uint32_t queueLimit)
{
return 0; //XXX the base class version does nothing
}
int Socket::Send (const uint8_t* buf, uint32_t size)
{
NS_LOG_FUNCTION_NOARGS ();
+2 -2
View File
@@ -231,9 +231,9 @@ public:
/**
* \brief Listen for incoming connections.
* \param queueLimit maximum number of incoming request to queue
* \returns XXX an error code
* \returns 0 on success, -1 on error (in which case errno is set).
*/
virtual int Listen (uint32_t queueLimit);
virtual int Listen (uint32_t queueLimit) = 0;
/**
* \brief Send data (or dummy data) to the remote host