- strcat(parameter, "\"}");
- printf("requestSurface(%s): %s\n", label, parameter);
- call(AFBClient::wmAPI, "request_surface", parameter);
+ strcat(parameter, end);
+
+ /* allocates an id for the request */
+ rc = asprintf(&key, "%d:%s/%s", ++num, AFBClient::wmAPI, verb);
+
+ /* send the request */
+ rc = afb_wsj1_call_s(wsj1, AFBClient::wmAPI, verb, parameter, AFBClient::onRequestSurfaceReply, key);
+ if (rc < 0)
+ fprintf(stderr, "calling %s/%s(%s) failed: %m\n", AFBClient::wmAPI, verb, parameter);
+
+ printf("requestSurface(%s) <--\n", label);
+ fflush(stdout);