A Discrete-Event Network Simulator
Home
Tutorials ▼
English
Portuguese
Docs ▼
Wiki
Manual
Models
Develop ▼
API
Bugs
API
Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Groups
Pages
udp-server.h
Go to the documentation of this file.
1
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2
/*
3
* Copyright (c) 2007,2008,2009 INRIA, UDCAST
4
*
5
* This program is free software; you can redistribute it and/or modify
6
* it under the terms of the GNU General Public License version 2 as
7
* published by the Free Software Foundation;
8
*
9
* This program is distributed in the hope that it will be useful,
10
* but WITHOUT ANY WARRANTY; without even the implied warranty of
11
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
* GNU General Public License for more details.
13
*
14
* You should have received a copy of the GNU General Public License
15
* along with this program; if not, write to the Free Software
16
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17
*
18
* Author: Amine Ismail <amine.ismail@sophia.inria.fr>
19
* <amine.ismail@udcast.com>
20
*
21
*/
22
23
#ifndef UDP_SERVER_H
24
#define UDP_SERVER_H
25
26
#include "ns3/application.h"
27
#include "ns3/event-id.h"
28
#include "ns3/ptr.h"
29
#include "ns3/address.h"
30
#include "
packet-loss-counter.h
"
31
namespace
ns3 {
45
class
UdpServer
:
public
Application
46
{
47
public
:
48
static
TypeId
GetTypeId
(
void
);
49
UdpServer
();
50
virtual
~UdpServer
();
55
uint32_t
GetLost
(
void
)
const
;
56
61
uint32_t
GetReceived
(
void
)
const
;
62
66
uint16_t
GetPacketWindowSize
()
const
;
67
74
void
SetPacketWindowSize
(uint16_t size);
75
protected
:
76
virtual
void
DoDispose
(
void
);
77
78
private
:
79
80
virtual
void
StartApplication
(
void
);
81
virtual
void
StopApplication
(
void
);
82
83
void
HandleRead
(
Ptr<Socket>
socket);
84
85
uint16_t
m_port
;
86
Ptr<Socket>
m_socket
;
87
Ptr<Socket>
m_socket6
;
88
Address
m_local
;
89
uint32_t
m_received
;
90
PacketLossCounter
m_lossCounter
;
91
};
92
93
}
// namespace ns3
94
95
#endif
/* UDP_SERVER_H */
ns3::Ptr< Socket >
ns3::UdpServer::GetPacketWindowSize
uint16_t GetPacketWindowSize() const
Definition:
udp-server.cc:77
ns3::UdpServer::m_local
Address m_local
Definition:
udp-server.h:88
ns3::UdpServer::GetLost
uint32_t GetLost(void) const
Definition:
udp-server.cc:91
ns3::UdpServer::SetPacketWindowSize
void SetPacketWindowSize(uint16_t size)
Set the size of the window used for checking loss. This value should be a multiple of 8...
Definition:
udp-server.cc:84
ns3::UdpServer::HandleRead
void HandleRead(Ptr< Socket > socket)
Definition:
udp-server.cc:152
ns3::UdpServer::m_port
uint16_t m_port
Definition:
udp-server.h:85
ns3::Address
a polymophic address class
Definition:
address.h:86
ns3::UdpServer::StartApplication
virtual void StartApplication(void)
Application specific startup code.
Definition:
udp-server.cc:112
ns3::UdpServer::~UdpServer
virtual ~UdpServer()
Definition:
udp-server.cc:71
ns3::Application
The base class for all ns3 applications.
Definition:
application.h:61
ns3::UdpServer::m_received
uint32_t m_received
Definition:
udp-server.h:89
ns3::UdpServer::StopApplication
virtual void StopApplication(void)
Application specific shutdown code.
Definition:
udp-server.cc:141
ns3::UdpServer::UdpServer
UdpServer()
Definition:
udp-server.cc:64
packet-loss-counter.h
ns3::UdpServer::GetTypeId
static TypeId GetTypeId(void)
Definition:
udp-server.cc:44
ns3::PacketLossCounter
Definition:
packet-loss-counter.h:36
ns3::UdpServer::m_socket6
Ptr< Socket > m_socket6
Definition:
udp-server.h:87
ns3::UdpServer::m_socket
Ptr< Socket > m_socket
Definition:
udp-server.h:86
ns3::UdpServer
A Udp server. Receives UDP packets from a remote host. UDP packets carry a 32bits sequence number fol...
Definition:
udp-server.h:45
ns3::UdpServer::DoDispose
virtual void DoDispose(void)
Definition:
udp-server.cc:105
ns3::TypeId
a unique identifier for an interface.
Definition:
type-id.h:49
ns3::UdpServer::m_lossCounter
PacketLossCounter m_lossCounter
Definition:
udp-server.h:90
ns3::UdpServer::GetReceived
uint32_t GetReceived(void) const
returns the number of received packets
Definition:
udp-server.cc:98
src
applications
model
udp-server.h
Generated on Sun Apr 20 2014 11:14:45 for ns-3 by
1.8.6