| 135 | } |
| 136 | |
| 137 | int Connect(const sockaddr* sa, socklen_t sa_len) const override { |
| 138 | CService service; |
| 139 | if (service.SetSockAddr(sa, sa_len) && service == CService(m_gateway_ip, 5351)) { |
| 140 | if (m_bound.IsBindAny()) { // If bind-any, bind to local ip. |
| 141 | m_bound = CService(m_local_ip, 0); |
| 142 | } |
| 143 | if (m_bound.GetPort() == 0) { // If no port assigned, assign port 1. |
| 144 | m_bound = CService(m_bound, 1); |
| 145 | } |
| 146 | m_connected = true; |
| 147 | return 0; |
| 148 | } |
| 149 | return -1; |
| 150 | } |
| 151 | |
| 152 | int Bind(const sockaddr* sa, socklen_t sa_len) const override { |
| 153 | CService service; |
nothing calls this directly
no test coverage detected