diff options
author | 2015-07-28 09:20:08 -0700 | |
---|---|---|
committer | 2015-07-28 09:20:08 -0700 | |
commit | e8afb2338f4d8ebb5cdab093aac342a4378604ab (patch) | |
tree | faafdf066ca220466cf98500a1656292fb24188b /src/php/ext/grpc/call.c | |
parent | 60b653bf35fad97f9b0187922ccea9cfb04f635d (diff) | |
parent | 8e06c2e62e0be2606598dd1f2a6582b585364520 (diff) |
Merge remote-tracking branch 'upstream/master' into jitter
Diffstat (limited to 'src/php/ext/grpc/call.c')
-rw-r--r-- | src/php/ext/grpc/call.c | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/src/php/ext/grpc/call.c b/src/php/ext/grpc/call.c index b67bae7568..1f76c7359d 100644 --- a/src/php/ext/grpc/call.c +++ b/src/php/ext/grpc/call.c @@ -473,6 +473,16 @@ cleanup: } /** + * Get the endpoint this call/stream is connected to + * @return string The URI of the endpoint + */ +PHP_METHOD(Call, getPeer) { + wrapped_grpc_call *call = + (wrapped_grpc_call *)zend_object_store_get_object(getThis() TSRMLS_CC); + RETURN_STRING(grpc_call_get_peer(call->wrapped), 1); +} + +/** * Cancel the call. This will cause the call to end with STATUS_CANCELLED if it * has not already ended with another status. */ @@ -485,7 +495,9 @@ PHP_METHOD(Call, cancel) { static zend_function_entry call_methods[] = { PHP_ME(Call, __construct, NULL, ZEND_ACC_PUBLIC | ZEND_ACC_CTOR) PHP_ME(Call, startBatch, NULL, ZEND_ACC_PUBLIC) - PHP_ME(Call, cancel, NULL, ZEND_ACC_PUBLIC) PHP_FE_END}; + PHP_ME(Call, getPeer, NULL, ZEND_ACC_PUBLIC) + PHP_ME(Call, cancel, NULL, ZEND_ACC_PUBLIC) + PHP_FE_END}; void grpc_init_call(TSRMLS_D) { zend_class_entry ce; |