aboutsummaryrefslogtreecommitdiffhomepage
path: root/include/grpc++
diff options
context:
space:
mode:
Diffstat (limited to 'include/grpc++')
-rw-r--r--include/grpc++/server.h3
-rw-r--r--include/grpc++/server_builder.h7
2 files changed, 9 insertions, 1 deletions
diff --git a/include/grpc++/server.h b/include/grpc++/server.h
index 18a8017880..210fe020ad 100644
--- a/include/grpc++/server.h
+++ b/include/grpc++/server.h
@@ -37,6 +37,7 @@
#include <list>
#include <memory>
+#include <grpc/compression.h>
#include <grpc++/completion_queue.h>
#include <grpc++/impl/call.h>
#include <grpc++/impl/grpc_library.h>
@@ -99,7 +100,7 @@ class Server GRPC_FINAL : public GrpcLibrary, private CallHook {
/// \param max_message_size Maximum message length that the channel can
/// receive.
Server(ThreadPoolInterface* thread_pool, bool thread_pool_owned,
- int max_message_size);
+ int max_message_size, grpc_compression_options compression_options);
/// Register a service. This call does not take ownership of the service.
/// The service must exist for the lifetime of the Server instance.
diff --git a/include/grpc++/server_builder.h b/include/grpc++/server_builder.h
index 496e7862c5..05937f150b 100644
--- a/include/grpc++/server_builder.h
+++ b/include/grpc++/server_builder.h
@@ -37,6 +37,7 @@
#include <memory>
#include <vector>
+#include <grpc/compression.h>
#include <grpc++/support/config.h>
namespace grpc {
@@ -92,6 +93,11 @@ class ServerBuilder {
max_message_size_ = max_message_size;
}
+ /// Set the compression options to be used by the server.
+ void SetCompressionOptions(const grpc_compression_options& options) {
+ compression_options_ = options;
+ }
+
/// Tries to bind \a server to the given \a addr.
///
/// It can be invoked multiple times.
@@ -133,6 +139,7 @@ class ServerBuilder {
};
int max_message_size_;
+ grpc_compression_options compression_options_;
std::vector<std::unique_ptr<NamedService<RpcService>>> services_;
std::vector<std::unique_ptr<NamedService<AsynchronousService>>>
async_services_;