ustd: convert to new ustcomm api
authorPierre-Marc Fournier <pierre-marc.fournier@polymtl.ca>
Tue, 17 Mar 2009 18:10:38 +0000 (14:10 -0400)
committerPierre-Marc Fournier <pierre-marc.fournier@polymtl.ca>
Tue, 17 Mar 2009 18:10:38 +0000 (14:10 -0400)
libustcomm/ustcomm.c
libustcomm/ustcomm.h
ustd/ustd.c

index f2aeb61fc423d2d818e89190fae44312d92f3658..5468ad4f9eebe74df02ece68166520de3bb52f06 100644 (file)
@@ -59,6 +59,7 @@ static void signal_process(pid_t pid)
                return;
        }
 
+       /* FIXME: should wait in a better way */
        sleep(1);
 }
 
index 7d22694cd6e47378360d3f422cb7cd6b5c207d74..052c896aca17ad6561e4d84910e617d04ca8ae07 100644 (file)
@@ -36,7 +36,7 @@ struct ustcomm_source {
 
 char *strdup_malloc(const char *s);
 
-int send_message_pid(pid_t pid, const char *msg, char **reply);
+//int send_message_pid(pid_t pid, const char *msg, char **reply);
 
 int ustcomm_ustd_recv_message(struct ustcomm_ustd *ustd, char **msg, struct ustcomm_source *src, int timeout);
 int ustcomm_app_recv_message(struct ustcomm_app *app, char **msg, struct ustcomm_source *src, int timeout);
@@ -45,6 +45,9 @@ int ustcomm_init_app(pid_t pid, struct ustcomm_app *handle);
 
 int ustcomm_init_ustd(struct ustcomm_ustd *handle);
 
+int ustcomm_connect_app(pid_t pid, struct ustcomm_connection *conn);
+int ustcomm_send_request(struct ustcomm_connection *conn, char *req, char **reply);
+
 int nth_token_is(char *str, char *token, int tok_no);
 
 char *nth_token(char *str, int tok_no);
index b66f1ced7e9e83788ee88ce00a72012464f83388..d5884dfe040c8bed7667a03e06784e444023c0e1 100644 (file)
@@ -65,9 +65,9 @@ int get_subbuffer(struct buffer_info *buf)
        int result;
 
        asprintf(&send_msg, "get_subbuffer %s", buf->name);
-       result = send_message(buf->pid, send_msg, &received_msg);
+       result = ustcomm_send_request(&buf->conn, send_msg, &received_msg);
        if(result < 0) {
-               ERR("get_subbuffer: send_message failed");
+               ERR("get_subbuffer: ustcomm_send_request failed");
                return -1;
        }
        free(send_msg);
@@ -107,7 +107,7 @@ int put_subbuffer(struct buffer_info *buf)
        int result;
 
        asprintf(&send_msg, "put_subbuffer %s %ld", buf->name, buf->consumed_old);
-       result = send_message(buf->pid, send_msg, &received_msg);
+       result = ustcomm_send_request(&buf->conn, send_msg, &received_msg);
        if(result < 0) {
                ERR("put_subbuffer: send_message failed");
                return -1;
This page took 0.028842 seconds and 4 git commands to generate.