MCPcopy Create free account
hub / github.com/Tencent/phxsql / Process

Method Process

phxbinlogsvr/core/agent/agent.cpp:68–88  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

66}
67
68int PhxBinLogAgent::Process() {
69 if (server_sockfd_ < 0) {
70 if (Bind(ip_.c_str(), port_)) {
71 server_sockfd_ = -1;
72 return SVR_FAIL;
73 }
74 }
75
76 while (1) {
77 int client_fd = NetIO::Accept(server_sockfd_);
78 if (client_fd < 0) {
79 STATISTICS(MySqlAcceptFail());
80 ColorLogError("recv client fd %d fail exit ", client_fd);
81 break;
82 }
83 STATISTICS(MySqlAcceptSucess());
84 data_manager_->DealWithSlave(client_fd);
85 }
86
87 return OK;
88}
89
90int PhxBinLogAgent::SendEvent(const string &oldgtid, const string &newgtid, const string &event_buffer) {
91 return data_manager_->SendEvent(oldgtid, newgtid, event_buffer);

Callers 2

ThreadProcessMethod · 0.45
CreateBinLogProcessMethod · 0.45

Calls 2

ColorLogErrorFunction · 0.85
DealWithSlaveMethod · 0.45

Tested by

no test coverage detected