+ /* Try to reuse an already openned socket to that expeditor */
+ gras_dynar_foreach(pd->sockets,cursor,sock_iter) {
+ DEBUG1("Consider %p as outgoing socket to expeditor",sock_iter);
+ sockdata = sock_iter->data;
+
+ if (sock_iter->raw || !sock_iter->outgoing)
+ continue;
+
+ if (sockdata->from_PID == r_pid) {
+ *dst=sock_iter;
+ return no_error;
+ }
+ }
+
+ /* Socket to expeditor not created yet */
+ DEBUG0("Create a socket to the expeditor");
+
+ TRY(gras_trp_plugin_get_by_name("sg",&trp));
+
+ TRY(gras_trp_socket_new(1,dst));
+ (*dst)->plugin = trp;
+
+ (*dst)->incoming = 1;
+ (*dst)->outgoing = 1;
+ (*dst)->accepting = 0;
+ (*dst)->sd = -1;
+
+ (*dst)->port = -1;
+
+ if (!(sockdata = malloc(sizeof(gras_trp_sg_sock_data_t))))
+ RAISE_MALLOC;