Connect the socket to its peer.
176 m_handle = socket(AF_INET, SOCK_STREAM, 0);
179 "failed to create stream socket (errno %d - %s)",
186 addr.sin_family = AF_INET;
187 addr.sin_port = htons(
m_port);
188 addr.sin_addr.s_addr = inet_addr(
m_address);
196 while (
unlikely(retval < 0 && errno == EINTR) );
201 "failed to connect TCP/IP socket @ %s:%d (errno %d - %s)",
static void * memset(void *, u8, u32)
Fill a memory block with a constant byte.
i8 * m_address
Peer IP address (numerical, IPv4)
i32 m_handle
Stream handle (descriptor)
struct sockaddr_in tcp_addr_t
TCP IPv4 address.
int i32
32-bit signed integer
struct sockaddr ip_addr_t
IP address.
#define unlikely(expr)
Offer a hint (negative) to the pipeline branch predictor.
virtual streambuf & close()
Close the stream.