A Discrete-Event Network Simulator
Home
Tutorials ▼
English
Documentation ▼
Installation
Manual
Models
Contributing
Wiki
Development ▼
API Docs
Issue Tracker
Merge Requests
API
ns3tcp-socket-writer.h
Go to the documentation of this file.
1
/*
2
* Copyright (c) 2010 University of Washington
3
*
4
* This program is free software; you can redistribute it and/or modify
5
* it under the terms of the GNU General Public License version 2 as
6
* published by the Free Software Foundation;
7
*
8
* This program is distributed in the hope that it will be useful,
9
* but WITHOUT ANY WARRANTY; without even the implied warranty of
10
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11
* GNU General Public License for more details.
12
*
13
* You should have received a copy of the GNU General Public License
14
* along with this program; if not, write to the Free Software
15
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
16
*/
17
18
#include "ns3/address.h"
19
#include "ns3/application.h"
20
#include "ns3/node.h"
21
#include "ns3/ptr.h"
22
#include "ns3/socket.h"
23
24
namespace
ns3
25
{
26
32
class
SocketWriter
:
public
Application
33
{
34
public
:
35
SocketWriter
();
36
~SocketWriter
()
override
;
41
static
TypeId
GetTypeId
();
42
48
void
Setup
(
Ptr<Node>
node,
Address
peer);
52
void
Connect
();
57
void
Write
(uint32_t numBytes);
61
void
Close
();
62
63
private
:
64
void
StartApplication
()
override
;
65
void
StopApplication
()
override
;
66
Address
m_peer
;
67
Ptr<Node>
m_node
;
68
Ptr<Socket>
m_socket
;
69
bool
m_isSetup
;
70
bool
m_isConnected
;
71
};
72
}
// namespace ns3
ns3::Address
a polymophic address class
Definition:
address.h:101
ns3::Application
The base class for all ns3 applications.
Definition:
application.h:62
ns3::Ptr< Node >
ns3::SocketWriter
Simple class to write data to sockets.
Definition:
ns3tcp-socket-writer.h:33
ns3::SocketWriter::m_peer
Address m_peer
Peer's address.
Definition:
ns3tcp-socket-writer.h:66
ns3::SocketWriter::SocketWriter
SocketWriter()
Definition:
ns3tcp-socket-writer.cc:26
ns3::SocketWriter::~SocketWriter
~SocketWriter() override
Definition:
ns3tcp-socket-writer.cc:34
ns3::SocketWriter::GetTypeId
static TypeId GetTypeId()
Register this type.
Definition:
ns3tcp-socket-writer.cc:42
ns3::SocketWriter::Connect
void Connect()
Connect the socket.
Definition:
ns3tcp-socket-writer.cc:72
ns3::SocketWriter::Setup
void Setup(Ptr< Node > node, Address peer)
Setup the socket.
Definition:
ns3tcp-socket-writer.cc:64
ns3::SocketWriter::Write
void Write(uint32_t numBytes)
Write to the socket.
Definition:
ns3tcp-socket-writer.cc:83
ns3::SocketWriter::m_node
Ptr< Node > m_node
Node pointer.
Definition:
ns3tcp-socket-writer.h:67
ns3::SocketWriter::Close
void Close()
Close the socket.
Definition:
ns3tcp-socket-writer.cc:94
ns3::SocketWriter::m_isSetup
bool m_isSetup
True if the socket is connected.
Definition:
ns3tcp-socket-writer.h:69
ns3::SocketWriter::StopApplication
void StopApplication() override
Application specific shutdown code.
Definition:
ns3tcp-socket-writer.cc:59
ns3::SocketWriter::m_socket
Ptr< Socket > m_socket
Socket.
Definition:
ns3tcp-socket-writer.h:68
ns3::SocketWriter::m_isConnected
bool m_isConnected
True if the socket setup has been done.
Definition:
ns3tcp-socket-writer.h:70
ns3::SocketWriter::StartApplication
void StartApplication() override
Application specific startup code.
Definition:
ns3tcp-socket-writer.cc:52
ns3::TypeId
a unique identifier for an interface.
Definition:
type-id.h:59
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
src
test
ns3tcp
ns3tcp-socket-writer.h
Generated on Sun Mar 3 2024 17:11:08 for ns-3 by
1.9.1