MCPcopy Create free account
hub / github.com/Tencent/phxsql / SendWithSeq

Method SendWithSeq

phxcomm/net/net.cpp:140–158  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

138}
139
140int NetIO::SendWithSeq(const int &fd, const string &send_buffer, const unsigned char &seq) {
141 SetSendTimeOut(fd);
142
143 string buffer;
144 char header[4];
145 int len = send_buffer.size();
146 memcpy(header, &len, 3);
147 header[3] = seq;
148
149 int ret = send(fd, header, sizeof(header), 0);
150 if (ret != sizeof(header))
151 return SOCKET_FAIL;
152
153 ret = send(fd, send_buffer.c_str(), send_buffer.size(), 0);
154 if (ret != (int) (send_buffer.size()))
155 return SOCKET_FAIL;
156
157 return OK;
158}
159
160void NetIO::Close(const int &fd) {
161 close(fd);

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected