Interplane page as plain text, for reading tools and agents. English is the reference text: translate it with your own tool. Text in backticks and in ``` blocks (commands, fingerprints, file names) and link targets in <...> are exact: copy them, never translate them. Page: /drakestapleton/ggml/blob/master/src/ggml-rpc/transport.h # ggml [Ported from github.com/ggml-org/ggml] docs : sync ggml_type enum in gguf.md (#1685) Brought by drakestapleton Sign in to star 0 stars 0 watching About Files History Releases Proposed changes Issues For developers branch `master` Branches Tags History `ggml / src / ggml-rpc / transport.h` 39 lines ยท 1057 bytes Raw Blame History 1 #pragma once 2 3 #include 4 #include 5 #include 6 7 struct socket_t; 8 typedef std::shared_ptr socket_ptr; 9 10 static constexpr size_t MAX_CHUNK_SIZE = 1024ull * 1024ull * 1024ull; // 1 GiB 11 static constexpr size_t RPC_CONN_CAPS_SIZE = 24; 12 13 struct socket_t { 14 ~socket_t(); 15 16 bool send_data(const void * data, size_t size); 17 bool recv_data(void * data, size_t size); 18 // Must be called at every message boundary: the RDMA transport coalesces 19 // writes into fixed-size frames and posts the trailing partial frame only 20 // here. No-op on TCP. 21 bool flush(); 22 23 socket_ptr accept(); 24 25 void get_caps(uint8_t * local_caps); 26 void update_caps(const uint8_t * remote_caps); 27 const char * transport_name() const; 28 29 static socket_ptr create_server(const char * host, int port); 30 static socket_ptr connect(const char * host, int port); 31 32 private: 33 struct impl; 34 explicit socket_t(std::unique_ptr p); 35 std::unique_ptr pimpl; 36 }; 37 38 bool rpc_transport_init(); 39 void rpc_transport_shutdown();