MCPcopy Create free account
hub / github.com/Tencent/Hardcoder / send

Method send

libapp2sys/src/main/cpp/udp.h:710–726  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

708 }
709
710 int64_t send(struct sockaddr_in addr, uint8_t *data, int len) {
711 SendPack *sendPack = new SendPack();
712
713 struct timeval now;
714 gettimeofday(&now, NULL);
715 sendPack->sessionid = (((int64_t) now.tv_sec) * 1000 * 1000) + now.tv_usec;
716
717 sendPack->toAddr = addr;
718 sendPack->len = len;
719 sendPack->data = new uint8_t[len];
720 memcpy(sendPack->data, data, len);
721
722 sendQueue.push(sendPack);
723 write(m_pipefd[1], &m_pipefd[1], sizeof(int));
724
725 return sendPack->sessionid;
726 }
727
728
729};

Callers 1

udpServerThreadMethod · 0.80

Calls 1

pushMethod · 0.80

Tested by

no test coverage detected