|
forb
|
The class from which any automatically generated skeleton will inherit. More...
#include <base_skeleton.hpp>
Public Member Functions | |
| base_skeleton (int port, int queue_size=10) | |
| Constructs a new skeleton object associated with the given port. More... | |
| virtual | ~base_skeleton ()=default |
| Virtual destructor. | |
| base_skeleton (const base_skeleton &other)=delete | |
| This class does not support copy construction. | |
| base_skeleton & | operator= (const base_skeleton &other)=delete |
| This class does not support copy assignment. | |
| base_skeleton (base_skeleton &&other) noexcept=default | |
| This class supports move construction. | |
| base_skeleton & | operator= (base_skeleton &&other) noexcept=default |
| This class supports move assignment. | |
| void | start_server () |
| The object will spawn a new thread ans start accepting connection requests. | |
| void | join_server () |
| Joins the server thread, waiting for it to terminate, which happens only in case of an error within the listening thread. More... | |
Protected Member Functions | |
| virtual void | execute_call (call_id_t code, forb::streams::stream *callstream, forb::streams::stream *datastream)=0 |
| Virtual method that implementations shall define to actually serve a request call. More... | |
Static Protected Member Functions | |
| static void | listen_thread_body (base_skeleton *impl) |
| The body of the server thread, which will block on accept calls and spawn other threads, one for each new request. More... | |
| static void | call_thread_body (base_skeleton *impl, forb::streams::socket call_socket) |
| The body of the threads which will serve each call request. More... | |
The class from which any automatically generated skeleton will inherit.
|
inlineexplicit |
Constructs a new skeleton object associated with the given port.
The second argument is optional and it's used to change the default queue size for the server socket.
|
staticprotected |
The body of the threads which will serve each call request.
One thread will be spawned for each incoming connection and it will be used to serve multiple request calls within the same connection, until the connection is closed.
|
protectedpure virtual |
Virtual method that implementations shall define to actually serve a request call.
Skeletons defining this method will be automatically generated by the FORB IDL compiler.
| void forb::base_skeleton::join_server | ( | ) |
Joins the server thread, waiting for it to terminate, which happens only in case of an error within the listening thread.
NOTICE: this function is not safe in the sense that some connection threads may still be around when this function terminates.
|
staticprotected |
The body of the server thread, which will block on accept calls and spawn other threads, one for each new request.
The first argument is a pointer to the actual implementation of the base_skeleton class.
1.8.12