Conversation
ba884bc to
5e99a3e
Compare
5e99a3e to
7d0138c
Compare
| set(THREADS_PREFER_PTHREAD_FLAG ON) | ||
| find_package(Threads REQUIRED) | ||
|
|
||
| set(CAPNP_LINKER_FLAGS "-lcapnp -lkj -lcapnp-rpc -lkj-async") |
There was a problem hiding this comment.
I see you linked these with target_link_libraries as well. Why do we need to add these to linker flags?
| @@ -0,0 +1,43 @@ | |||
| module; | |||
There was a problem hiding this comment.
Best not to separate include and src directories. Since we use modules, just use the directory hierarchy as the module hierarchy
| @@ -0,0 +1,15 @@ | |||
| @0x9c4f255fd44cfc76; | |||
There was a problem hiding this comment.
Shall we move this somewhere outside the root src dir?
|
|
||
| export void test_network() | ||
| { | ||
| pid_t serverProcess = fork(); |
There was a problem hiding this comment.
Do we have to run two processes to recieve and send messages? Is there any way we can do this with only one process?
| STATUS_SUCCESS_WITH_DATA | ||
| }; | ||
|
|
||
| struct ResultDefStruct |
There was a problem hiding this comment.
Does't really like using the type in the name. Isn't uaf::rpc::Response a better name?
| } | ||
| }; | ||
|
|
||
| export void start_server(std::string host_address) |
There was a problem hiding this comment.
Best to stick to OOP with RAII as much as possible
| return kj::Promise<uaf::ResultDefStruct>(std::move(uaf::ResultDefStruct(status, {0x7A, 0x71, 0x72, 0x73}))); | ||
| } | ||
|
|
||
| class ResultDefImpl final : public MessageDefInterface::ResultDef::Server |
There was a problem hiding this comment.
Looks more like a Java naming convention :) Not that clear what this class does
Not a complete implementation of the rpc. just the client server communication with random bytes.
Wanted to get the compilation flow right -> automatic generation of capnp files and compilation of the overall thing.
If you run, make sure to kill the server process manually for now.