aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar Muxi Yan <muxi@users.noreply.github.com>2018-03-26 11:33:23 -0700
committerGravatar Muxi Yan <mxyan@google.com>2018-03-26 17:18:25 -0700
commita6ffad97250ffa6eef28fc5230d69ceaadeb8a31 (patch)
tree120bc118023105e98f66a4411217d2d92895a0ef
parent6d855c5f3c7518e2b26a97e464ebb9366da05993 (diff)
Polish comments for setKeepaliveWithInterval
-rw-r--r--src/objective-c/GRPCClient/GRPCCall+ChannelArg.h8
-rw-r--r--src/objective-c/tests/InteropTests.m3
2 files changed, 8 insertions, 3 deletions
diff --git a/src/objective-c/GRPCClient/GRPCCall+ChannelArg.h b/src/objective-c/GRPCClient/GRPCCall+ChannelArg.h
index 0c3f37de81..b6d3938af0 100644
--- a/src/objective-c/GRPCClient/GRPCCall+ChannelArg.h
+++ b/src/objective-c/GRPCClient/GRPCCall+ChannelArg.h
@@ -46,9 +46,11 @@ typedef NS_ENUM(NSInteger, GRPCCompressAlgorithm) {
+ (void)setDefaultCompressMethod:(GRPCCompressAlgorithm)algorithm
forhost:(nonnull NSString *)host;
-/** Configure keepalive timeout parameters. A client ping after \a interval ms to check if the
- * transport is still alive. After waiting for \a timeout ms, if the client does not receive the
- * ping ack, it closes the transport. */
+/** Enable keepalive and configure keepalive parameters. A user should call this function once to
+ * enable keepalive for a particular host. gRPC client sends a ping after every \a interval ms to
+ * check if the transport is still alive. After waiting for \a timeout ms, if the client does not
+ * receive the ping ack, it closes the transport; all pending calls to this host will fail with
+ * error GRPC_STATUS_INTERNAL with error information "keepalive watchdog timeout". */
+ (void)setKeepaliveWithInterval:(int)interval
timeout:(int)timeout
forHost:(nonnull NSString *)host;
diff --git a/src/objective-c/tests/InteropTests.m b/src/objective-c/tests/InteropTests.m
index 66fea22c83..7a8bc9bd79 100644
--- a/src/objective-c/tests/InteropTests.m
+++ b/src/objective-c/tests/InteropTests.m
@@ -515,6 +515,9 @@ BOOL isRemoteInteropTest(NSString *host) {
} else {
// Keepalive should kick after 1s elapsed and fails the call.
XCTAssertNotNil(error);
+ XCTAssertEqual(error.code, GRPC_STATUS_INTERNAL);
+ XCTAssertEqualObjects(error.localizedDescription, @"keepalive watchdog timeout",
+ @"Unexpected failure that is not keepalive watchdog timeout.");
XCTAssertTrue(done);
[expectation fulfill];
}