| 66 | } |
| 67 | |
| 68 | int 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 | |
| 90 | int PhxBinLogAgent::SendEvent(const string &oldgtid, const string &newgtid, const string &event_buffer) { |
| 91 | return data_manager_->SendEvent(oldgtid, newgtid, event_buffer); |
no test coverage detected