OrcaSlicer latest
OrcaSlicer
Loading...
Searching...
No Matches
Slic3r::GUI::HttpServer::IOServer Class Reference
Collaboration diagram for Slic3r::GUI::HttpServer::IOServer:

Public Member Functions

 IOServer (HttpServer &server)
void do_accept ()
void start (std::shared_ptr< session > session)
void stop (std::shared_ptr< session > session)
void stop_all ()

Public Attributes

HttpServer & server
boost::asio::io_context io_service
boost::asio::ip::tcp::acceptor acceptor
std::set< std::shared_ptr< session > > sessions

Detailed Description

Constructor & Destructor Documentation

◆ IOServer()

Slic3r::GUI::HttpServer::IOServer::IOServer ( HttpServer & server)
inline
144: server(server), acceptor(io_service, {boost::asio::ip::tcp::v4(), server.port}) {}
HttpServer & server
Definition HttpServer.hpp:139
boost::asio::ip::tcp::acceptor acceptor
Definition HttpServer.hpp:141
boost::asio::io_context io_service
Definition HttpServer.hpp:140

References Slic3r::GUI::HttpServer::HttpServer(), acceptor, io_service, and server.

Here is the call graph for this function:

Member Function Documentation

◆ do_accept()

void Slic3r::GUI::HttpServer::IOServer::do_accept ( )
135{
136 acceptor.async_accept([this](boost::system::error_code ec, boost::asio::ip::tcp::socket socket) {
137 if (!acceptor.is_open()) {
138 return;
139 }
140
141 if (!ec) {
142 const auto ss = std::make_shared<session>(*this, std::move(socket));
143 start(ss);
144 }
145
146 do_accept();
147 });
148}
void do_accept()
Definition HttpServer.cpp:134
void start()
Definition HttpServer.cpp:178

References acceptor, do_accept(), and Slic3r::GUI::HttpServer::start().

Referenced by do_accept(), and Slic3r::GUI::HttpServer::start().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ start()

void Slic3r::GUI::HttpServer::IOServer::start ( std::shared_ptr< session > session)
151{
152 sessions.insert(session);
153 session->start();
154}
std::set< std::shared_ptr< session > > sessions
Definition HttpServer.hpp:142
friend class session
Definition HttpServer.hpp:152

References Slic3r::GUI::HttpServer::session, and sessions.

Here is the call graph for this function:

◆ stop()

void Slic3r::GUI::HttpServer::IOServer::stop ( std::shared_ptr< session > session)
157{
158 sessions.erase(session);
159 session->stop();
160}

References Slic3r::GUI::HttpServer::session, and sessions.

Here is the call graph for this function:

◆ stop_all()

void Slic3r::GUI::HttpServer::IOServer::stop_all ( )
163{
164 for (auto s : sessions) {
165 s->stop();
166 }
167 sessions.clear();
168}

References sessions.

Member Data Documentation

◆ acceptor

boost::asio::ip::tcp::acceptor Slic3r::GUI::HttpServer::IOServer::acceptor

◆ io_service

boost::asio::io_context Slic3r::GUI::HttpServer::IOServer::io_service

◆ server

HttpServer& Slic3r::GUI::HttpServer::IOServer::server

Referenced by IOServer().

◆ sessions

std::set<std::shared_ptr<session> > Slic3r::GUI::HttpServer::IOServer::sessions

Referenced by start(), stop(), and stop_all().


The documentation for this class was generated from the following files:
  • /home/runner/work/OrcaSlicer/OrcaSlicer/src/slic3r/GUI/HttpServer.hpp
  • /home/runner/work/OrcaSlicer/OrcaSlicer/src/slic3r/GUI/HttpServer.cpp