ust: first try at blocking support for consumer
[ust.git] / libustcomm / ustcomm.c
index 6047b6012bc5f5abb98c45c2e28a4038b6b438a6..2b08b310b826b0de71c3a1b42d8bd6ac289e747b 100644 (file)
@@ -316,6 +316,26 @@ int ustcomm_app_recv_message(struct ustcomm_app *app, char **msg, struct ustcomm
        return ustcomm_recv_message(&app->server, msg, src, timeout);
 }
 
+/* This removes src from the list of active connections of app.
+ */
+
+int ustcomm_app_detach_client(struct ustcomm_app *app, struct ustcomm_source *src)
+{
+       struct ustcomm_server *server = (struct ustcomm_server *)app;
+       struct ustcomm_connection *conn;
+
+       list_for_each_entry(conn, &server->connections, list) {
+               if(conn->fd == src->fd) {
+                       list_del(&conn->list);
+                       goto found;
+               }
+       }
+
+       return -1;
+found:
+       return src->fd;
+}
+
 static int init_named_socket(char *name, char **path_out)
 {
        int result;
This page took 0.022608 seconds and 4 git commands to generate.