diff options
Diffstat (limited to 'test/core/util/port.h')
-rw-r--r-- | test/core/util/port.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/test/core/util/port.h b/test/core/util/port.h index 154e8f830c..602099dea6 100644 --- a/test/core/util/port.h +++ b/test/core/util/port.h @@ -23,6 +23,12 @@ extern "C" { #endif +typedef struct grpc_pick_port_functions { + int (*pick_unused_port_fn)(void); + int (*pick_unused_port_or_die_fn)(void); + void (*recycle_unused_port_fn)(int port); +} grpc_pick_port_functions; + /* pick a port number that is currently unused by either tcp or udp. return 0 on failure. */ int grpc_pick_unused_port(void); @@ -36,6 +42,9 @@ int grpc_pick_unused_port_or_die(void); * ports back to the server if it is going to allocate a large number. */ void grpc_recycle_unused_port(int port); +/** Request the family of pick_port functions in \a functions be used. */ +void grpc_set_pick_port_functions(grpc_pick_port_functions functions); + #ifdef __cplusplus } #endif |