MCPcopy Create free account
hub / github.com/F-Stack/f-stack / GetConnLink

Method GetConnLink

adapter/micro_thread/mt_net.cpp:251–273  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

249}
250
251int32_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
275int32_t CNetHandler::WaitConnect(uint64_t timeout)
276{

Callers 1

SendRecvMethod · 0.95

Calls 4

LinkMethod · 0.95
SetKeyInfoMethod · 0.80
FindCreateDestMethod · 0.80
GetSockLinkMethod · 0.80

Tested by

no test coverage detected