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

Function mt_tcpsendrcv_ex

adapter/micro_thread/mt_api.cpp:438–478  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

436}
437
438int mt_tcpsendrcv_ex(struct sockaddr_in* dst, void* pkg, int len, void* rcv_buf, int* buf_size, int timeout, MtFuncTcpMsgLen func, MT_TCP_CONN_TYPE type)
439{
440 if(!dst || !pkg || len<1)
441 {
442 MTLOG_ERROR("input params invalid, dst[%p], pkg[%p], rcv_buf[%p], fun[%p], len[%d], buf_size[%p]type[%d]",
443 dst, pkg, rcv_buf, func, len, buf_size,type);
444 return -10;
445 }
446
447 switch (type)
448 {
449 case MT_TCP_LONG:
450 {
451 return mt_tcpsendrcv(dst, pkg, len, rcv_buf, *buf_size, timeout, func);
452 }
453
454 case MT_TCP_LONG_SNDONLY:
455 {
456 return mt_tcpsend(dst, pkg, len, timeout);
457 }
458
459 case MT_TCP_SHORT:
460 {
461 return mt_tcpsendrcv_short(dst, pkg, len, rcv_buf, *buf_size, timeout, func);
462 }
463
464 case MT_TCP_SHORT_SNDONLY:
465 {
466 return mt_tcpsend_short(dst, pkg, len, timeout);
467 }
468
469 default:
470 {
471 MTLOG_ERROR("input params invalid, dst[%p], pkg[%p], rcv_buf[%p], fun[%p], len[%d], buf_size[%p]type[%d]",
472 dst, pkg, rcv_buf, func, len, buf_size,type);
473 return -10;
474 }
475 }
476
477 return 0;
478}
479
480static void mt_task_process(void* arg)
481{

Callers

nothing calls this directly

Calls 4

mt_tcpsendrcvFunction · 0.85
mt_tcpsendFunction · 0.85
mt_tcpsendrcv_shortFunction · 0.85
mt_tcpsend_shortFunction · 0.85

Tested by

no test coverage detected