MCPcopy Create free account
hub / github.com/apache/brpc / GetShortSocket

Method GetShortSocket

src/brpc/socket.cpp:2834–2856  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2832}
2833
2834int Socket::GetShortSocket(SocketUniquePtr* short_socket) {
2835 if (short_socket == NULL) {
2836 LOG(ERROR) << "short_socket is NULL";
2837 return -1;
2838 }
2839 SocketId id;
2840 SocketOptions opt;
2841 opt.remote_side = remote_side();
2842 opt.local_side = butil::EndPoint(local_side().ip, 0);
2843 opt.user = user();
2844 opt.on_edge_triggered_events = _on_edge_triggered_events;
2845 opt.need_on_edge_trigger = _need_on_edge_trigger;
2846 opt.initial_ssl_ctx = _ssl_ctx;
2847 opt.keytable_pool = _keytable_pool;
2848 opt.app_connect = _app_connect;
2849 opt.socket_mode = _socket_mode;
2850 if (get_client_side_messenger()->Create(opt, &id) != 0 ||
2851 Address(id, short_socket) != 0) {
2852 return -1;
2853 }
2854 (*short_socket)->ShareStats(this);
2855 return 0;
2856}
2857
2858int Socket::GetAgentSocket(SocketUniquePtr* out, bool (*checkfn)(Socket*)) {
2859 SocketId id = _agent_socket_id.load(butil::memory_order_relaxed);

Callers 1

IssueRPCMethod · 0.80

Calls 6

remote_sideFunction · 0.85
EndPointClass · 0.85
local_sideFunction · 0.85
userFunction · 0.85
ShareStatsMethod · 0.80
CreateMethod · 0.45

Tested by

no test coverage detected