A Discrete-Event Network Simulator
Home
Tutorials ▼
English
Documentation ▼
Manual
Models
Contributing
Wiki
Development ▼
API Docs
Issue Tracker
Merge Requests
API
ns3tcp-socket-writer.h
Go to the documentation of this file.
1
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2
/*
3
* Copyright (c) 2010 University of Washington
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
19
#include "ns3/application.h"
20
#include "ns3/node.h"
21
#include "ns3/ptr.h"
22
#include "ns3/socket.h"
23
#include "ns3/address.h"
24
25
namespace
ns3
26
{
27
33
class
SocketWriter
:
public
Application
34
{
35
public
:
36
SocketWriter
();
37
virtual
~SocketWriter
();
42
static
TypeId
GetTypeId
(
void
);
43
49
void
Setup
(
Ptr<Node>
node,
Address
peer);
53
void
Connect
();
58
void
Write
(uint32_t numBytes);
62
void
Close
();
63
64
private
:
65
virtual
void
StartApplication
(
void
);
66
virtual
void
StopApplication
(
void
);
67
Address
m_peer
;
68
Ptr<Node>
m_node
;
69
Ptr<Socket>
m_socket
;
70
bool
m_isSetup
;
71
bool
m_isConnected
;
72
};
73
}
ns3::Address
a polymophic address class
Definition:
address.h:91
ns3::Application
The base class for all ns3 applications.
Definition:
application.h:61
ns3::Ptr< Node >
ns3::SocketWriter
Simple class to write data to sockets.
Definition:
ns3tcp-socket-writer.h:34
ns3::SocketWriter::m_peer
Address m_peer
Peer's address.
Definition:
ns3tcp-socket-writer.h:67
ns3::SocketWriter::SocketWriter
SocketWriter()
Definition:
ns3tcp-socket-writer.cc:26
ns3::SocketWriter::StopApplication
virtual void StopApplication(void)
Application specific shutdown code.
Definition:
ns3tcp-socket-writer.cc:56
ns3::SocketWriter::Connect
void Connect()
Connect the socket.
Definition:
ns3tcp-socket-writer.cc:69
ns3::SocketWriter::Setup
void Setup(Ptr< Node > node, Address peer)
Setup the socket.
Definition:
ns3tcp-socket-writer.cc:61
ns3::SocketWriter::StartApplication
virtual void StartApplication(void)
Application specific startup code.
Definition:
ns3tcp-socket-writer.cc:49
ns3::SocketWriter::GetTypeId
static TypeId GetTypeId(void)
Register this type.
Definition:
ns3tcp-socket-writer.cc:38
ns3::SocketWriter::Write
void Write(uint32_t numBytes)
Write to the socket.
Definition:
ns3tcp-socket-writer.cc:80
ns3::SocketWriter::m_node
Ptr< Node > m_node
Node pointer.
Definition:
ns3tcp-socket-writer.h:68
ns3::SocketWriter::Close
void Close()
Close the socket.
Definition:
ns3tcp-socket-writer.cc:91
ns3::SocketWriter::m_isSetup
bool m_isSetup
True if the socket is connected.
Definition:
ns3tcp-socket-writer.h:70
ns3::SocketWriter::m_socket
Ptr< Socket > m_socket
Socket.
Definition:
ns3tcp-socket-writer.h:69
ns3::SocketWriter::m_isConnected
bool m_isConnected
True if the socket setup has been done.
Definition:
ns3tcp-socket-writer.h:71
ns3::SocketWriter::~SocketWriter
virtual ~SocketWriter()
Definition:
ns3tcp-socket-writer.cc:30
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 Tue Feb 6 2024 19:21:27 for ns-3 by
1.9.1