Functions | Variables
channel.c File Reference
#include "channel.h"
#include <ext/standard/php_var.h>
#include <ext/standard/sha1.h>
#include <zend_smart_str.h>
#include <ext/spl/spl_exceptions.h>
#include <zend_exceptions.h>
#include <grpc/grpc_security.h>
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
#include "completion_queue.h"
#include "channel_credentials.h"
#include "timeval.h"
Include dependency graph for channel.c:

Go to the source code of this file.

Functions

void create_and_add_channel_to_persistent_list (wrapped_grpc_channel *channel, char *target, grpc_channel_args args, wrapped_grpc_channel_credentials *creds, char *key, php_grpc_int key_len, int target_upper_bound TSRMLS_DC)
 
void create_channel (wrapped_grpc_channel *channel, char *target, grpc_channel_args args, wrapped_grpc_channel_credentials *creds)
 
php_grpc_zend_object create_wrapped_grpc_channel (zend_class_entry *class_type TSRMLS_DC)
 
void free_grpc_channel_wrapper (grpc_channel_wrapper *channel, bool free_channel)
 
void generate_sha1_str (char *sha1str, char *str, php_grpc_int len)
 
 GRPC_STARTUP_FUNCTION (channel)
 
 if (p->wrapper !=NULL)
 
static void php_grpc_channel_plink_dtor (php_grpc_zend_resource *rsrc TSRMLS_DC)
 
void php_grpc_channel_ref (grpc_channel_wrapper *wrapper)
 
void php_grpc_channel_unref (grpc_channel_wrapper *wrapper)
 
void php_grpc_delete_persistent_list_entry (char *key, php_grpc_int key_len TSRMLS_DC)
 
static bool php_grpc_not_channel_arg_key (const char *key)
 
bool php_grpc_persistent_list_delete_unused_channel (char *target, target_bound_le_t *target_bound_status TSRMLS_DC)
 
int php_grpc_read_args_array (zval *args_array, grpc_channel_args *args TSRMLS_DC)
 
static void php_grpc_target_bound_dtor (php_grpc_zend_resource *rsrc TSRMLS_DC)
 
 PHP_METHOD (Channel, __construct)
 
 PHP_METHOD (Channel, close)
 
 PHP_METHOD (Channel, getConnectivityState)
 
 PHP_METHOD (Channel, getTarget)
 
 PHP_METHOD (Channel, watchConnectivityState)
 
target_bound_le_tupdate_and_get_target_upper_bound (char *target, int bound)
 

Variables

static zend_function_entry channel_methods []
 
static gpr_mu global_persistent_list_mu
 
zend_class_entry * grpc_ce_channel
 
HashTable grpc_persistent_list
 
HashTable grpc_target_upper_bound_map
 
int le_bound
 
int le_plink
 

Function Documentation

◆ create_and_add_channel_to_persistent_list()

void create_and_add_channel_to_persistent_list ( wrapped_grpc_channel *  channel,
char *  target,
grpc_channel_args  args,
wrapped_grpc_channel_credentials *  creds,
char *  key,
php_grpc_int  key_len,
int target_upper_bound  TSRMLS_DC 
)

Definition at line 256 of file channel.c.

◆ create_channel()

void create_channel ( wrapped_grpc_channel *  channel,
char *  target,
grpc_channel_args  args,
wrapped_grpc_channel_credentials *  creds 
)

Definition at line 238 of file channel.c.

◆ create_wrapped_grpc_channel()

php_grpc_zend_object create_wrapped_grpc_channel ( zend_class_entry *class_type  TSRMLS_DC)

Definition at line 94 of file channel.c.

◆ free_grpc_channel_wrapper()

void free_grpc_channel_wrapper ( grpc_channel_wrapper channel,
bool  free_channel 
)

Definition at line 48 of file channel.c.

◆ generate_sha1_str()

void generate_sha1_str ( char *  sha1str,
char *  str,
php_grpc_int  len 
)

Definition at line 167 of file channel.c.

◆ GRPC_STARTUP_FUNCTION()

GRPC_STARTUP_FUNCTION ( channel  )

Definition at line 785 of file channel.c.

◆ if()

if ( p->wrapper = NULL)

Definition at line 86 of file channel.c.

◆ php_grpc_channel_plink_dtor()

static void php_grpc_channel_plink_dtor ( php_grpc_zend_resource *rsrc  TSRMLS_DC)
static

Definition at line 592 of file channel.c.

◆ php_grpc_channel_ref()

void php_grpc_channel_ref ( grpc_channel_wrapper wrapper)

Definition at line 63 of file channel.c.

◆ php_grpc_channel_unref()

void php_grpc_channel_unref ( grpc_channel_wrapper wrapper)

Definition at line 69 of file channel.c.

◆ php_grpc_delete_persistent_list_entry()

void php_grpc_delete_persistent_list_entry ( char *  key,
php_grpc_int key_len  TSRMLS_DC 
)

Definition at line 580 of file channel.c.

◆ php_grpc_not_channel_arg_key()

static bool php_grpc_not_channel_arg_key ( const char *  key)
static

Definition at line 102 of file channel.c.

◆ php_grpc_persistent_list_delete_unused_channel()

bool php_grpc_persistent_list_delete_unused_channel ( char *  target,
target_bound_le_t *target_bound_status  TSRMLS_DC 
)

Definition at line 177 of file channel.c.

◆ php_grpc_read_args_array()

int php_grpc_read_args_array ( zval *  args_array,
grpc_channel_args *args  TSRMLS_DC 
)

Definition at line 117 of file channel.c.

◆ php_grpc_target_bound_dtor()

static void php_grpc_target_bound_dtor ( php_grpc_zend_resource *rsrc  TSRMLS_DC)
static

Definition at line 607 of file channel.c.

◆ PHP_METHOD() [1/5]

PHP_METHOD ( Channel  ,
__construct   
)

Construct an instance of the Channel class.

By default, the underlying grpc_channel is "persistent". That is, given the same set of parameters passed to the constructor, the same underlying grpc_channel will be returned.

If the $args array contains a "credentials" key mapping to a ChannelCredentials object, a secure channel will be created with those credentials.

If the $args array contains a "force_new" key mapping to a boolean value of "true", a new and separate underlying grpc_channel will be created and returned. This will not affect existing channels.

Parameters
string$targetThe hostname to associate with this channel
array$args_arrayThe arguments to pass to the Channel

Definition at line 321 of file channel.c.

◆ PHP_METHOD() [2/5]

PHP_METHOD ( Channel  ,
close   
)

Close the channel

Returns
void

Definition at line 569 of file channel.c.

◆ PHP_METHOD() [3/5]

PHP_METHOD ( Channel  ,
getConnectivityState   
)

Get the connectivity state of the channel

Parameters
bool$try_to_connectTry to connect on the channel (optional)
Returns
long The grpc connectivity state

Definition at line 496 of file channel.c.

◆ PHP_METHOD() [4/5]

PHP_METHOD ( Channel  ,
getTarget   
)

Get the endpoint this call/stream is connected to

Returns
string The URI of the endpoint

Definition at line 475 of file channel.c.

◆ PHP_METHOD() [5/5]

PHP_METHOD ( Channel  ,
watchConnectivityState   
)

Watch the connectivity state of the channel until it changed

Parameters
long$last_stateThe previous connectivity state of the channel
Timeval$deadline_objThe deadline this function should wait until
Returns
bool If the connectivity state changes from last_state before deadline

Definition at line 528 of file channel.c.

◆ update_and_get_target_upper_bound()

target_bound_le_t* update_and_get_target_upper_bound ( char *  target,
int  bound 
)

Definition at line 204 of file channel.c.

Variable Documentation

◆ channel_methods

zend_function_entry channel_methods[]
static
Initial value:
= {
PHP_ME(Channel, __construct, arginfo_construct,
ZEND_ACC_PUBLIC | ZEND_ACC_CTOR)
PHP_ME(Channel, getTarget, arginfo_getTarget,
ZEND_ACC_PUBLIC)
PHP_ME(Channel, getConnectivityState, arginfo_getConnectivityState,
ZEND_ACC_PUBLIC)
PHP_ME(Channel, watchConnectivityState, arginfo_watchConnectivityState,
ZEND_ACC_PUBLIC)
PHP_ME(Channel, close, arginfo_close,
ZEND_ACC_PUBLIC)
PHP_FE_END
}

Definition at line 763 of file channel.c.

◆ global_persistent_list_mu

gpr_mu global_persistent_list_mu
static

Definition at line 42 of file channel.c.

◆ grpc_ce_channel

zend_class_entry* grpc_ce_channel

class Channel

See also
https://github.com/grpc/grpc/tree/master/src/php/ext/grpc/channel.c

Definition at line 40 of file channel.c.

◆ grpc_persistent_list

HashTable grpc_persistent_list

Definition at line 45 of file php_grpc.c.

◆ grpc_target_upper_bound_map

HashTable grpc_target_upper_bound_map

Definition at line 46 of file php_grpc.c.

◆ le_bound

int le_bound

Definition at line 44 of file channel.c.

◆ le_plink

int le_plink

Definition at line 43 of file channel.c.

framework.rpc.grpc_channelz.Channel
Channel
Definition: grpc_channelz.py:32
close
#define close
Definition: test-fs.c:48


grpc
Author(s):
autogenerated on Fri May 16 2025 03:01:06