| 2832 | } |
| 2833 | |
| 2834 | int 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 | |
| 2858 | int Socket::GetAgentSocket(SocketUniquePtr* out, bool (*checkfn)(Socket*)) { |
| 2859 | SocketId id = _agent_socket_id.load(butil::memory_order_relaxed); |
no test coverage detected