+/* --- @conn_fd@ --- *
+ *
+ * Arguments: @conn *c@ = pointer to connection block
+ * @sel_state *s@ = pointer to select state to attach to
+ * @int fd@ = file descriptor of socket
+ * @void (*func)(int fd, void *p) = handler function
+ * @void *p@ = argument for the handler function
+ *
+ * Returns: ---
+ *
+ * Use: Sets up a nonblocking connect job. The socket should have a
+ * connect pending for it already.
+ */
+
+void conn_fd(conn *c, sel_state *s, int fd,
+ void (*func)(int /*fd*/, void */*p*/),
+ void *p)
+{
+ c->func = func;
+ c->p = p;
+ sel_initfile(s, &c->writer, fd, SEL_WRITE, conn_connect, c);
+ sel_addfile(&c->writer);
+}
+