1 #include <dragonnet/send.h>
6 #include <sys/socket.h>
9 bool dragonnet_send_raw(DragonnetPeer *p, bool submit, const void *buf, size_t n)
11 ssize_t len = send(p->sock, buf, n, MSG_NOSIGNAL | (submit ? 0 : MSG_MORE));
14 if (errno == ECONNRESET || errno == EPIPE || errno == ETIMEDOUT) {
15 shutdown(p->sock, SHUT_RDWR);
16 pthread_mutex_unlock(&p->mtx);
25 pthread_mutex_unlock(&p->mtx);