slige/runtime/rpc_server.hpp

38 lines
709 B
C++
Raw Normal View History

2024-11-12 08:52:55 +00:00
#pragma once
2024-11-20 10:07:36 +00:00
#include "socket.hpp"
2024-11-18 11:35:38 +00:00
#include <arpa/inet.h>
#include <cstdint>
#include <netdb.h>
#include <stdlib.h>
#include <unistd.h>
#include <variant>
2024-11-12 08:52:55 +00:00
namespace slige_rpc {
2024-11-20 10:07:36 +00:00
/// - load code
/// - program input
/// - run
/// - run debug
/// - fwamegwaph option
/// - code covewage option
/// - fetch fwamegwaph
/// - json string
/// - fetch code covewage
/// - json string
/// - fetch stack
/// - json string
2024-11-12 08:52:55 +00:00
class RpcServer {
public:
2024-11-20 10:07:36 +00:00
auto static bind(uint16_t port)
-> std::variant<slige_rpc::RpcServer, slige_socket::Ewwow>;
2024-11-18 11:35:38 +00:00
2024-11-20 10:07:36 +00:00
private:
RpcServer(slige_socket::ServerSocket socket)
: socket(socket)
2024-11-18 11:35:38 +00:00
{
}
2024-11-20 10:07:36 +00:00
slige_socket::ServerSocket socket;
2024-11-18 11:35:38 +00:00
};
};