Lines Matching refs:code
71 int SocketClient::sendMsg(int code, const char *msg, bool addErrno) {
72 return sendMsg(code, msg, addErrno, mUseCmdNum);
75 int SocketClient::sendMsg(int code, const char *msg, bool addErrno, bool useCmdNum) {
81 ret = asprintf(&buf, "%d %d %s (%s)", code, getCmdNum(), msg, strerror(errno));
83 ret = asprintf(&buf, "%d %s (%s)", code, msg, strerror(errno));
87 ret = asprintf(&buf, "%d %d %s", code, getCmdNum(), msg);
89 ret = asprintf(&buf, "%d %s", code, msg);
100 // send 3-digit code, null, binary-length, binary data
101 int SocketClient::sendBinaryMsg(int code, const void *data, int len) {
103 // 4 bytes for the code & null + 4 bytes for the len
105 // Write the code
106 snprintf(buf, 4, "%.3d", code);
124 // Sends the code (c-string null-terminated).
125 int SocketClient::sendCode(int code) {
127 snprintf(buf, sizeof(buf), "%.3d", code);