| 249 | } |
| 250 | |
| 251 | int32_t CNetHandler::GetConnLink() |
| 252 | { |
| 253 | CDestLinks key; |
| 254 | key.SetKeyInfo(_dest_ipv4.sin_addr.s_addr, _dest_ipv4.sin_port, _proto_type, _conn_type); |
| 255 | |
| 256 | CDestLinks* dest_link = CNetMgr::Instance()->FindCreateDest(&key); |
| 257 | if (NULL == dest_link) |
| 258 | { |
| 259 | MTLOG_ERROR("get dest link handle failed"); |
| 260 | return RC_MEM_ERROR; |
| 261 | } |
| 262 | |
| 263 | CSockLink* sock_link = dest_link->GetSockLink(); |
| 264 | if (NULL == sock_link) |
| 265 | { |
| 266 | MTLOG_ERROR("get sock link handle failed"); |
| 267 | return RC_MEM_ERROR; |
| 268 | } |
| 269 | |
| 270 | this->Link(sock_link); |
| 271 | |
| 272 | return 0; |
| 273 | } |
| 274 | |
| 275 | int32_t CNetHandler::WaitConnect(uint64_t timeout) |
| 276 | { |
no test coverage detected