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

Method CheckParams

adapter/micro_thread/mt_net.cpp:218–249  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

216}
217
218int32_t CNetHandler::CheckParams()
219{
220 if ((NULL == _req_data) || (_req_len == 0))
221 {
222 MTLOG_ERROR("param invalid, data[%p], len[%u]", _req_data, _req_len);
223 return RC_INVALID_PARAM;
224 }
225
226 if ((_dest_ipv4.sin_addr.s_addr == 0) || (_dest_ipv4.sin_port == 0))
227 {
228 MTLOG_ERROR("param invalid, ip[%u], port[%u]", _dest_ipv4.sin_addr.s_addr,
229 _dest_ipv4.sin_port);
230 return RC_INVALID_PARAM;
231 }
232
233 if (_conn_type == TYPE_CONN_SESSION)
234 {
235 if ((_callback == NULL) || (_session_id == 0))
236 {
237 MTLOG_ERROR("param invalid, callback[%p], session_id[%llu]", _callback, _session_id);
238 return RC_INVALID_PARAM;
239 }
240
241 if (!this->RegistSession())
242 {
243 MTLOG_ERROR("param invalid, session_id[%llu] regist failed", _session_id);
244 return RC_CONFLICT_SID;
245 }
246 }
247
248 return 0;
249}
250
251int32_t CNetHandler::GetConnLink()
252{

Callers 1

SendRecvMethod · 0.95

Calls 1

RegistSessionMethod · 0.95

Tested by

no test coverage detected