View | Details | Raw Unified | Return to bug 638
Collapse All | Expand All

(-)a/src/applications/udp-echo/udp-echo-client.cc (-2 / +7 lines)
 Lines 24-29    Link Here 
24
#include "ns3/socket-factory.h"
24
#include "ns3/socket-factory.h"
25
#include "ns3/packet.h"
25
#include "ns3/packet.h"
26
#include "ns3/uinteger.h"
26
#include "ns3/uinteger.h"
27
#include "ns3/trace-source-accessor.h"
27
#include "udp-echo-client.h"
28
#include "udp-echo-client.h"
28
29
29
namespace ns3 {
30
namespace ns3 {
 Lines 62-67    Link Here 
62
                   MakeUintegerAccessor (&UdpEchoClient::SetDataSize,
63
                   MakeUintegerAccessor (&UdpEchoClient::SetDataSize,
63
                                         &UdpEchoClient::GetDataSize),
64
                                         &UdpEchoClient::GetDataSize),
64
                   MakeUintegerChecker<uint32_t> ())
65
                   MakeUintegerChecker<uint32_t> ())
66
    .AddTraceSource ("Tx", "A new packet is created and is sent",
67
                     MakeTraceSourceAccessor (&UdpEchoClient::m_txTrace))
65
    ;
68
    ;
66
  return tid;
69
  return tid;
67
}
70
}
 Lines 246-251    Link Here 
246
249
247
  NS_ASSERT (m_sendEvent.IsExpired ());
250
  NS_ASSERT (m_sendEvent.IsExpired ());
248
251
252
  Ptr<Packet> p;
249
  if (m_dataSize)
253
  if (m_dataSize)
250
    {
254
    {
251
      //
255
      //
 Lines 256-262    Link Here 
256
      //
260
      //
257
      NS_ASSERT_MSG (m_dataSize == m_size, "UdpEchoClient::Send(): m_size and m_dataSize inconsistent");
261
      NS_ASSERT_MSG (m_dataSize == m_size, "UdpEchoClient::Send(): m_size and m_dataSize inconsistent");
258
      NS_ASSERT_MSG (m_data, "UdpEchoClient::Send(): m_dataSize but no m_data");
262
      NS_ASSERT_MSG (m_data, "UdpEchoClient::Send(): m_dataSize but no m_data");
259
      Ptr<Packet> p = Create<Packet> (m_data, m_dataSize);
263
      p = Create<Packet> (m_data, m_dataSize);
260
      m_socket->Send (p);
264
      m_socket->Send (p);
261
    }
265
    }
262
  else
266
  else
 Lines 268-280    Link Here 
268
      // this case, we don't worry about it either.  But we do allow m_size
272
      // this case, we don't worry about it either.  But we do allow m_size
269
      // to have a value different from the (zero) m_dataSize.
273
      // to have a value different from the (zero) m_dataSize.
270
      //
274
      //
271
      Ptr<Packet> p = Create<Packet> (m_size);
275
      p = Create<Packet> (m_size);
272
      m_socket->Send (p);
276
      m_socket->Send (p);
273
    }
277
    }
274
278
275
  ++m_sent;
279
  ++m_sent;
276
280
277
  NS_LOG_INFO ("Sent " << m_size << " bytes to " << m_peerAddress);
281
  NS_LOG_INFO ("Sent " << m_size << " bytes to " << m_peerAddress);
282
  m_txTrace (p);
278
283
279
  if (m_sent < m_count) 
284
  if (m_sent < m_count) 
280
    {
285
    {
(-)a/src/applications/udp-echo/udp-echo-client.h (-1 / +3 lines)
 Lines 23-28    Link Here 
23
#include "ns3/event-id.h"
23
#include "ns3/event-id.h"
24
#include "ns3/ptr.h"
24
#include "ns3/ptr.h"
25
#include "ns3/ipv4-address.h"
25
#include "ns3/ipv4-address.h"
26
#include "ns3/traced-callback.h"
26
27
27
namespace ns3 {
28
namespace ns3 {
28
29
 Lines 140-146    Link Here 
140
  Ipv4Address m_peerAddress;
141
  Ipv4Address m_peerAddress;
141
  uint16_t m_peerPort;
142
  uint16_t m_peerPort;
142
  EventId m_sendEvent;
143
  EventId m_sendEvent;
143
144
  /// Callbacks for tracing the packet Tx events
145
  TracedCallback<Ptr<const Packet> > m_txTrace;
144
};
146
};
145
147
146
} // namespace ns3
148
} // namespace ns3

Return to bug 638