-static struct afb_stub_ws *afb_stub_ws_create(struct fdev *fdev, const char *apiname, struct afb_apiset *apiset, int client)
+static struct afb_proto_ws *afb_stub_ws_create_proto(struct afb_stub_ws *stubws, struct fdev *fdev, uint8_t is_client)
+{
+ struct afb_proto_ws *proto;
+
+ stubws->proto = proto = is_client
+ ? afb_proto_ws_create_client(fdev, &client_itf, stubws)
+ : afb_proto_ws_create_server(fdev, &server_itf, stubws);
+ if (proto) {
+ afb_proto_ws_on_hangup(proto, on_hangup);
+ afb_proto_ws_set_queuing(proto, enqueue_processing);
+ }
+
+ return proto;
+}
+
+static struct afb_stub_ws *afb_stub_ws_create(struct fdev *fdev, const char *apiname, struct afb_apiset *apiset, uint8_t is_client)