+static void fio_netio_udp_close(struct thread_data *td, struct fio_file *f)
+{
+ struct netio_data *nd = td->io_ops->data;
+ struct udp_close_msg msg;
+ struct sockaddr *to = (struct sockaddr *) &nd->addr;
+ int ret;
+
+ msg.magic = htonl(FIO_LINK_CLOSE_MAGIC);
+ msg.cmd = htonl(FIO_LINK_CLOSE);
+
+ ret = sendto(f->fd, &msg, sizeof(msg), MSG_WAITALL, to,
+ sizeof(nd->addr));
+ if (ret < 0)
+ td_verror(td, errno, "sendto udp link close");
+}
+
+static int fio_netio_close_file(struct thread_data *td, struct fio_file *f)
+{
+ struct netio_data *nd = td->io_ops->data;
+
+ /*
+ * If this is an UDP connection, notify the receiver that we are
+ * closing down the link
+ */
+ if (nd->type == FIO_TYPE_UDP)
+ fio_netio_udp_close(td, f);
+
+ return generic_close_file(td, f);
+}
+
+static int fio_netio_setup_connect_inet(struct thread_data *td,
+ const char *host, unsigned short port)