gRPC C++ | How to get server ip from connected client in case of multiple listening ports ?

27 views
Skip to first unread message

find.abd...@gmail.com

unread,
Dec 19, 2018, 7:11:51 AM12/19/18
to grpc.io
Hi,

I have a server with multiple listening ports:

for (auto &address : addresses) {
  builder.AddListeningPort(address, credentials);
}

I would like to identify on which listening port of server a client is connected.
We can get a connected client address by using: ServerContext::peer()

Similarly, I tried to get server address by using FromServerContext(*m_serverContext)->peer() after successful authentication, but the string was empty.

Is there any way to get server address ?
Reply all
Reply to author
Forward
0 new messages