(accept) (closure, connected_socket);
}
+/* Exported: see wdo-socket.h for documentation. */
+ttt_status_t
+ttt_socket_create_client (const char *host,
+ const char *port,
+ int *socket_ret)
+{
+ ttt_status_t status;
+ struct sockaddr_in addr;
+ int socket;
+
+ *socket_ret = -1;
+
+ socket = xsocket (PF_INET, SOCK_STREAM, 0);
+
+ _sockaddr_init (&addr, host, port);
+
+ status = xconnect (socket, (struct sockaddr *) &addr, sizeof (addr));
+ if (status) {
+ shutdown (socket, SHUT_RDWR);
+ return status;
+ }
+
+ *socket_ret = socket;
+ return TTT_STATUS_SUCCESS;
+}
+
/* Exported: see ttt-socket.h for documentation. */
void
ttt_socket_read (int socket,