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);
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);
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);
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;