rogue
Loading...
Searching...
No Matches
Server.cpp
Go to the documentation of this file.
1
17#include "rogue/Directives.h"
18
20
21#include <memory>
22
23#include "rogue/GeneralError.h"
24#include "rogue/GilRelease.h"
28
29namespace rpr = rogue::protocols::rssi;
31
32#ifndef NO_PYTHON
33 #include <boost/python.hpp>
34namespace bp = boost::python;
35#endif
36
38rpr::ServerPtr rpr::Server::create(uint32_t segSize) {
39 rpr::ServerPtr r = std::make_shared<rpr::Server>(segSize);
40 return (r);
41}
42
43void rpr::Server::setup_python() {
44#ifndef NO_PYTHON
45
46 bp::class_<rpr::Server, rpr::ServerPtr, boost::noncopyable>("Server", bp::init<uint32_t>())
47 .def("transport", &rpr::Server::transport)
48 .def("application", &rpr::Server::application)
49 .def("getOpen", &rpr::Server::getOpen)
50 .def("getDownCount", &rpr::Server::getDownCount)
51 .def("getDropCount", &rpr::Server::getDropCount)
52 .def("getRetranCount", &rpr::Server::getRetranCount)
53 .def("getLocBusy", &rpr::Server::getLocBusy)
54 .def("getLocBusyCnt", &rpr::Server::getLocBusyCnt)
55 .def("getRemBusy", &rpr::Server::getRemBusy)
56 .def("getRemBusyCnt", &rpr::Server::getRemBusyCnt)
57 .def("setLocTryPeriod", &rpr::Server::setLocTryPeriod)
58 .def("getLocTryPeriod", &rpr::Server::getLocTryPeriod)
59 .def("setLocMaxBuffers", &rpr::Server::setLocMaxBuffers)
60 .def("getLocMaxBuffers", &rpr::Server::getLocMaxBuffers)
61 .def("setLocMaxSegment", &rpr::Server::setLocMaxSegment)
62 .def("getLocMaxSegment", &rpr::Server::getLocMaxSegment)
63 .def("setLocCumAckTout", &rpr::Server::setLocCumAckTout)
64 .def("getLocCumAckTout", &rpr::Server::getLocCumAckTout)
65 .def("setLocRetranTout", &rpr::Server::setLocRetranTout)
66 .def("getLocRetranTout", &rpr::Server::getLocRetranTout)
67 .def("setLocNullTout", &rpr::Server::setLocNullTout)
68 .def("getLocNullTout", &rpr::Server::getLocNullTout)
69 .def("setLocMaxRetran", &rpr::Server::setLocMaxRetran)
70 .def("getLocMaxRetran", &rpr::Server::getLocMaxRetran)
71 .def("setLocMaxCumAck", &rpr::Server::setLocMaxCumAck)
72 .def("getLocMaxCumAck", &rpr::Server::getLocMaxCumAck)
73 .def("curMaxBuffers", &rpr::Server::curMaxBuffers)
74 .def("curMaxSegment", &rpr::Server::curMaxSegment)
75 .def("curCumAckTout", &rpr::Server::curCumAckTout)
76 .def("curRetranTout", &rpr::Server::curRetranTout)
77 .def("curNullTout", &rpr::Server::curNullTout)
78 .def("curMaxRetran", &rpr::Server::curMaxRetran)
79 .def("curMaxCumAck", &rpr::Server::curMaxCumAck)
80 .def("resetCounters", &rpr::Server::resetCounters)
81 .def("setTimeout", &rpr::Server::setTimeout)
82 .def("_stop", &rpr::Server::stop)
83 .def("_start", &rpr::Server::start);
84#endif
85}
86
88rpr::Server::Server(uint32_t segSize) {
89 app_ = rpr::Application::create();
90 tran_ = rpr::Transport::create();
91 cntl_ = rpr::Controller::create(segSize, tran_, app_, true);
92
93 app_->setController(cntl_);
94 tran_->setController(cntl_);
95}
96
98rpr::Server::~Server() {
99 cntl_->stop();
100}
101
103rpr::TransportPtr rpr::Server::transport() {
104 return (tran_);
105}
106
108rpr::ApplicationPtr rpr::Server::application() {
109 return (app_);
110}
111
113bool rpr::Server::getOpen() {
114 return (cntl_->getOpen());
115}
116
118uint32_t rpr::Server::getDownCount() {
119 return (cntl_->getDownCount());
120}
121
123uint32_t rpr::Server::getDropCount() {
124 return (cntl_->getDropCount());
125}
126
128uint32_t rpr::Server::getRetranCount() {
129 return (cntl_->getRetranCount());
130}
131
133bool rpr::Server::getLocBusy() {
134 return (cntl_->getLocBusy());
135}
136
138uint32_t rpr::Server::getLocBusyCnt() {
139 return (cntl_->getLocBusyCnt());
140}
141
143bool rpr::Server::getRemBusy() {
144 return (cntl_->getRemBusy());
145}
146
148uint32_t rpr::Server::getRemBusyCnt() {
149 return (cntl_->getRemBusyCnt());
150}
151
152void rpr::Server::setLocTryPeriod(uint32_t val) {
153 cntl_->setLocTryPeriod(val);
154}
155
156uint32_t rpr::Server::getLocTryPeriod() {
157 return cntl_->getLocTryPeriod();
158}
159
160void rpr::Server::setLocMaxBuffers(uint8_t val) {
161 cntl_->setLocMaxBuffers(val);
162}
163
164uint8_t rpr::Server::getLocMaxBuffers() {
165 return cntl_->getLocMaxBuffers();
166}
167
168void rpr::Server::setLocMaxSegment(uint16_t val) {
169 cntl_->setLocMaxSegment(val);
170}
171
172uint16_t rpr::Server::getLocMaxSegment() {
173 return cntl_->getLocMaxSegment();
174}
175
176void rpr::Server::setLocCumAckTout(uint16_t val) {
177 cntl_->setLocCumAckTout(val);
178}
179
180uint16_t rpr::Server::getLocCumAckTout() {
181 return cntl_->getLocCumAckTout();
182}
183
184void rpr::Server::setLocRetranTout(uint16_t val) {
185 cntl_->setLocRetranTout(val);
186}
187
188uint16_t rpr::Server::getLocRetranTout() {
189 return cntl_->getLocRetranTout();
190}
191
192void rpr::Server::setLocNullTout(uint16_t val) {
193 cntl_->setLocNullTout(val);
194}
195
196uint16_t rpr::Server::getLocNullTout() {
197 return cntl_->getLocNullTout();
198}
199
200void rpr::Server::setLocMaxRetran(uint8_t val) {
201 cntl_->setLocMaxRetran(val);
202}
203
204uint8_t rpr::Server::getLocMaxRetran() {
205 return cntl_->getLocMaxRetran();
206}
207
208void rpr::Server::setLocMaxCumAck(uint8_t val) {
209 cntl_->setLocMaxCumAck(val);
210}
211
212uint8_t rpr::Server::getLocMaxCumAck() {
213 return cntl_->getLocMaxCumAck();
214}
215
216uint8_t rpr::Server::curMaxBuffers() {
217 return cntl_->curMaxBuffers();
218}
219
220uint16_t rpr::Server::curMaxSegment() {
221 return cntl_->curMaxSegment();
222}
223
224uint16_t rpr::Server::curCumAckTout() {
225 return cntl_->curCumAckTout();
226}
227
228uint16_t rpr::Server::curRetranTout() {
229 return cntl_->curRetranTout();
230}
231
232uint16_t rpr::Server::curNullTout() {
233 return cntl_->curNullTout();
234}
235
236uint8_t rpr::Server::curMaxRetran() {
237 return cntl_->curMaxRetran();
238}
239
240uint8_t rpr::Server::curMaxCumAck() {
241 return cntl_->curMaxCumAck();
242}
243
244void rpr::Server::resetCounters() {
245 cntl_->resetCounters();
246}
247
249void rpr::Server::setTimeout(uint32_t timeout) {
250 cntl_->setTimeout(timeout);
251}
252
254void rpr::Server::stop() {
255 return (cntl_->stop());
256}
257
259void rpr::Server::start() {
260 return (cntl_->start());
261}
std::shared_ptr< rogue::protocols::rssi::Transport > TransportPtr
Definition Transport.h:91
std::shared_ptr< rogue::protocols::rssi::Server > ServerPtr
Definition Server.h:220
std::shared_ptr< rogue::protocols::rssi::Application > ApplicationPtr