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 app_->stop();
101}
102
104rpr::TransportPtr rpr::Server::transport() {
105 return (tran_);
106}
107
109rpr::ApplicationPtr rpr::Server::application() {
110 return (app_);
111}
112
114bool rpr::Server::getOpen() {
115 return (cntl_->getOpen());
116}
117
119uint32_t rpr::Server::getDownCount() {
120 return (cntl_->getDownCount());
121}
122
124uint32_t rpr::Server::getDropCount() {
125 return (cntl_->getDropCount());
126}
127
129uint32_t rpr::Server::getRetranCount() {
130 return (cntl_->getRetranCount());
131}
132
134bool rpr::Server::getLocBusy() {
135 return (cntl_->getLocBusy());
136}
137
139uint32_t rpr::Server::getLocBusyCnt() {
140 return (cntl_->getLocBusyCnt());
141}
142
144bool rpr::Server::getRemBusy() {
145 return (cntl_->getRemBusy());
146}
147
149uint32_t rpr::Server::getRemBusyCnt() {
150 return (cntl_->getRemBusyCnt());
151}
152
153void rpr::Server::setLocTryPeriod(uint32_t val) {
154 cntl_->setLocTryPeriod(val);
155}
156
157uint32_t rpr::Server::getLocTryPeriod() {
158 return cntl_->getLocTryPeriod();
159}
160
161void rpr::Server::setLocMaxBuffers(uint8_t val) {
162 cntl_->setLocMaxBuffers(val);
163}
164
165uint8_t rpr::Server::getLocMaxBuffers() {
166 return cntl_->getLocMaxBuffers();
167}
168
169void rpr::Server::setLocMaxSegment(uint16_t val) {
170 cntl_->setLocMaxSegment(val);
171}
172
173uint16_t rpr::Server::getLocMaxSegment() {
174 return cntl_->getLocMaxSegment();
175}
176
177void rpr::Server::setLocCumAckTout(uint16_t val) {
178 cntl_->setLocCumAckTout(val);
179}
180
181uint16_t rpr::Server::getLocCumAckTout() {
182 return cntl_->getLocCumAckTout();
183}
184
185void rpr::Server::setLocRetranTout(uint16_t val) {
186 cntl_->setLocRetranTout(val);
187}
188
189uint16_t rpr::Server::getLocRetranTout() {
190 return cntl_->getLocRetranTout();
191}
192
193void rpr::Server::setLocNullTout(uint16_t val) {
194 cntl_->setLocNullTout(val);
195}
196
197uint16_t rpr::Server::getLocNullTout() {
198 return cntl_->getLocNullTout();
199}
200
201void rpr::Server::setLocMaxRetran(uint8_t val) {
202 cntl_->setLocMaxRetran(val);
203}
204
205uint8_t rpr::Server::getLocMaxRetran() {
206 return cntl_->getLocMaxRetran();
207}
208
209void rpr::Server::setLocMaxCumAck(uint8_t val) {
210 cntl_->setLocMaxCumAck(val);
211}
212
213uint8_t rpr::Server::getLocMaxCumAck() {
214 return cntl_->getLocMaxCumAck();
215}
216
217uint8_t rpr::Server::curMaxBuffers() {
218 return cntl_->curMaxBuffers();
219}
220
221uint16_t rpr::Server::curMaxSegment() {
222 return cntl_->curMaxSegment();
223}
224
225uint16_t rpr::Server::curCumAckTout() {
226 return cntl_->curCumAckTout();
227}
228
229uint16_t rpr::Server::curRetranTout() {
230 return cntl_->curRetranTout();
231}
232
233uint16_t rpr::Server::curNullTout() {
234 return cntl_->curNullTout();
235}
236
237uint8_t rpr::Server::curMaxRetran() {
238 return cntl_->curMaxRetran();
239}
240
241uint8_t rpr::Server::curMaxCumAck() {
242 return cntl_->curMaxCumAck();
243}
244
245void rpr::Server::resetCounters() {
246 cntl_->resetCounters();
247}
248
250void rpr::Server::setTimeout(uint32_t timeout) {
251 cntl_->setTimeout(timeout);
252}
253
255void rpr::Server::stop() {
256 return (cntl_->stop());
257}
258
260void rpr::Server::start() {
261 return (cntl_->start());
262}
std::shared_ptr< rogue::protocols::rocev2::Server > ServerPtr
Definition Server.h:192