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

Method Socket

src/brpc/socket.cpp:448–497  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

446static const uint64_t AUTH_FLAG = (1ul << 32);
447
448Socket::Socket(Forbidden f)
449 // must be even because Address() relies on evenness of version
450 : VersionedRefWithId<Socket>(f)
451 , _shared_part(NULL)
452 , _nevent(0)
453 , _keytable_pool(NULL)
454 , _fd(-1)
455 , _tos(0)
456 , _reset_fd_real_us(-1)
457 , _on_edge_triggered_events(NULL)
458 , _need_on_edge_trigger(false)
459 , _user(NULL)
460 , _conn(NULL)
461 , _preferred_index(-1)
462 , _hc_count(0)
463 , _last_msg_size(0)
464 , _avg_msg_size(0)
465 , _last_readtime_us(0)
466 , _parsing_context(NULL)
467 , _correlation_id(0)
468 , _health_check_interval_s(-1)
469 , _is_hc_related_ref_held(false)
470 , _ninprocess(1)
471 , _auth_flag_error(0)
472 , _auth_id(INVALID_BTHREAD_ID)
473 , _auth_context(NULL)
474 , _ssl_state(SSL_UNKNOWN)
475 , _ssl_session(NULL)
476 , _socket_mode(SOCKET_MODE_TCP)
477 , _connection_type_for_progressive_read(CONNECTION_TYPE_UNKNOWN)
478 , _controller_released_socket(false)
479 , _overcrowded(false)
480 , _fail_me_at_server_stop(false)
481 , _logoff_flag(false)
482 , _error_code(0)
483 , _pipeline_q(NULL)
484 , _last_writetime_us(0)
485 , _unwritten_bytes(0)
486 , _epollout_butex(NULL)
487 , _write_head(NULL)
488 , _is_write_shutdown(false)
489 , _stream_set(NULL)
490 , _total_streams_unconsumed_size(0)
491 , _ninflight_app_health_check(0)
492 , _tcp_user_timeout_ms(-1)
493 , _http_request_method(HTTP_METHOD_GET) {
494 CreateVarsOnce();
495 pthread_mutex_init(&_id_wait_list_mutex, NULL);
496 _epollout_butex = bthread::butex_create_checked<butil::atomic<int> >();
497}
498
499Socket::~Socket() {
500 pthread_mutex_destroy(&_id_wait_list_mutex);

Callers

nothing calls this directly

Calls 1

pthread_mutex_initFunction · 0.85

Tested by

no test coverage detected