+ (accept) (closure, connected_socket);
+}
+
+/* Exported: see ttt-socket.h for documentation. */
+void
+ttt_socket_read (int socket,
+ void *buf,
+ size_t count)
+{
+ int bytes_read;
+ char *cbuf = buf;
+
+ while (count) {
+ bytes_read = xread (socket, cbuf, count);
+ cbuf += bytes_read;
+ count -= bytes_read;
+ }
+}
+
+/* Exported: see ttt-socket.h for documentation. */
+void
+ttt_socket_write (int socket,
+ const void *buf,
+ size_t count)
+{
+ int written;
+ const char *cbuf = buf;