| 596 | } |
| 597 | |
| 598 | int32_t CNetHandler::HashCmp(HashKey* rhs) |
| 599 | { |
| 600 | CNetHandler* data = (CNetHandler*)(rhs); |
| 601 | if (!data) { |
| 602 | return -1; |
| 603 | } |
| 604 | if (this->_session_id != data->_session_id) |
| 605 | { |
| 606 | return (this->_session_id > data->_session_id) ? 1 : -1; |
| 607 | } |
| 608 | |
| 609 | if (this->_dest_ipv4.sin_addr.s_addr != data->_dest_ipv4.sin_addr.s_addr) { |
| 610 | return (this->_dest_ipv4.sin_addr.s_addr > data->_dest_ipv4.sin_addr.s_addr) ? 1 : -1; |
| 611 | } |
| 612 | if (this->_dest_ipv4.sin_port != data->_dest_ipv4.sin_port) { |
| 613 | return (this->_dest_ipv4.sin_port > data->_dest_ipv4.sin_port) ? 1 : -1; |
| 614 | } |
| 615 | if (this->_proto_type != data->_proto_type) { |
| 616 | return (this->_proto_type > data->_proto_type) ? 1 : -1; |
| 617 | } |
| 618 | if (this->_conn_type != data->_conn_type) { |
| 619 | return (this->_conn_type > data->_conn_type) ? 1 : -1; |
| 620 | } |
| 621 | |
| 622 | return 0; |
| 623 | }; |
| 624 | |
| 625 | bool CNetHandler::RegistSession() |
| 626 | { |
no outgoing calls
no test coverage detected