24 #include <netcomm/socket/stream.h>
26 #include <sys/types.h>
27 #include <sys/socket.h>
28 #include <netinet/in.h>
29 #include <netinet/tcp.h>
47 :
Socket(PF_INET, SOCK_STREAM, 0, timeout)
81 socklen_t val_len =
sizeof(val);
82 if ( getsockopt(
sock_fd, IPPROTO_TCP, TCP_NODELAY, &val, &val_len) == -1 ) {
83 throw SocketException(
"StreamSocket::nodelay: getsockopt failed", errno);
96 int val = (nodelay ? 1 : 0);
97 socklen_t val_len =
sizeof(val);
98 if ( setsockopt(
sock_fd, IPPROTO_TCP, TCP_NODELAY, &val, val_len) == -1 ) {
99 throw SocketException(
"StreamSocket::set_nodelay: setsockopt failed", errno);
StreamSocket(float timeout=0.f)
Constructor.
Fawkes library namespace.
TCP stream socket over IP.
virtual Socket * clone()
Clone socket.
bool nodelay()
Check if Nalge algorithm is disabled.
int sock_fd
Socket file descriptor.
void set_nodelay(bool no_delay)
Enable or disable Nagle algorithm.