Lines Matching refs:rc
239 ssize_t rc; in connack() local
243 rc = swrite(fd, (char *)packet, sizeof(packet)); in connack()
244 if(rc > 0) { in connack()
245 logmsg("WROTE %zd bytes [CONNACK]", rc); in connack()
246 loghex(packet, rc); in connack()
249 if(rc == sizeof(packet)) { in connack()
263 ssize_t rc; in suback() local
267 rc = swrite(fd, (char *)packet, sizeof(packet)); in suback()
268 if(rc == sizeof(packet)) { in suback()
269 logmsg("WROTE %zd bytes [SUBACK]", rc); in suback()
270 loghex(packet, rc); in suback()
271 logprotocol(FROM_SERVER, "SUBACK", 3, dump, packet, rc); in suback()
285 ssize_t rc; in puback() local
289 rc = swrite(fd, (char *)packet, sizeof(packet)); in puback()
290 if(rc == sizeof(packet)) { in puback()
291 logmsg("WROTE %zd bytes [PUBACK]", rc); in puback()
292 loghex(packet, rc); in puback()
293 logprotocol(FROM_SERVER, dump, packet, rc); in puback()
307 ssize_t rc = swrite(fd, (char *)packet, sizeof(packet)); in disconnect() local
308 if(rc == sizeof(packet)) { in disconnect()
309 logmsg("WROTE %zd bytes [DISCONNECT]", rc); in disconnect()
310 loghex(packet, rc); in disconnect()
311 logprotocol(FROM_SERVER, "DISCONNECT", 0, dump, packet, rc); in disconnect()
398 ssize_t rc; in publish() local
436 rc = swrite(fd, (char *)packet, sendamount); in publish()
437 if(rc > 0) { in publish()
438 logmsg("WROTE %zd bytes [PUBLISH]", rc); in publish()
439 loghex(packet, rc); in publish()
440 logprotocol(FROM_SERVER, "PUBLISH", remaininglength, dump, packet, rc); in publish()
443 if((size_t)rc == packetlen) in publish()
462 ssize_t rc = sread(fd, (char *)buffer, 2); in fixedheader() local
464 if(rc < 2) { in fixedheader()
465 logmsg("READ %zd bytes [SHORT!]", rc); in fixedheader()
468 logmsg("READ %zd bytes", rc); in fixedheader()
469 loghex(buffer, rc); in fixedheader()
476 rc = sread(fd, (char *)&buffer[i], 1); in fixedheader()
477 if(rc != 1) { in fixedheader()
492 ssize_t rc; in mqttit() local
538 rc = fixedheader(fd, &byte, &remaining_length, &bytes); in mqttit()
539 if(rc) in mqttit()
553 rc = sread(fd, (char *)buffer, remaining_length); in mqttit()
554 if(rc > 0) { in mqttit()
555 logmsg("READ %zd bytes", rc); in mqttit()
556 loghex(buffer, rc); in mqttit()
562 dump, buffer, rc); in mqttit()
593 if((ssize_t)payload_len != (rc - 12)) { in mqttit()
595 rc - 12, payload_len); in mqttit()
621 dump, buffer, rc); in mqttit()
624 if(rc < 6) { in mqttit()
679 dump, buffer, rc); in mqttit()
691 rc = sread(fd, (char *)&buffer[0], 2); in mqttit()
693 logmsg("READ %zd bytes [DISCONNECT]", rc); in mqttit()
694 loghex(buffer, rc); in mqttit()
695 logprotocol(FROM_CLIENT, "DISCONNECT", 0, dump, buffer, rc); in mqttit()
741 ssize_t rc; in incoming() local
755 rc = select(maxfd + 1, &fds_read, &fds_write, &fds_err, NULL); in incoming()
760 } while((rc == -1) && ((error = SOCKERRNO) == EINTR)); in incoming()
762 if(rc < 0) { in incoming()
797 int rc; in sockdaemon() local
807 rc = setsockopt(sock, SOL_SOCKET, SO_REUSEADDR, in sockdaemon()
809 if(rc) { in sockdaemon()
814 rc = wait_ms(delay); in sockdaemon()
815 if(rc) { in sockdaemon()
817 logmsg("wait_ms() failed with error: %d", rc); in sockdaemon()
830 } while(rc && maxretr--); in sockdaemon()
832 if(rc) { in sockdaemon()
848 rc = bind(sock, &listener.sa, sizeof(listener.sa4)); in sockdaemon()
856 rc = bind(sock, &listener.sa, sizeof(listener.sa6)); in sockdaemon()
859 if(rc) { in sockdaemon()
912 rc = listen(sock, 5); in sockdaemon()
913 if(0 != rc) { in sockdaemon()