- if (rx_cfg->verbose)
- {
- printf ("SERVER (fd %d): Received a cfg message!\n",
- client_fd);
- sock_test_cfg_dump (rx_cfg, 0 /* is_client */ );
- }
-
- if (rx_bytes != sizeof (*rx_cfg))
- {
- printf ("SERVER (fd %d): Invalid cfg message "
- "size (%d)!\n Should be %lu bytes.\n",
- client_fd, rx_bytes, sizeof (*rx_cfg));
- conn->cfg.rxbuf_size = 0;
- conn->cfg.num_writes = 0;
- if (conn->cfg.verbose)
- {
- printf ("SERVER (fd %d): Replying to "
- "cfg message!\n", client_fd);
- sock_test_cfg_dump (rx_cfg, 0 /* is_client */ );
- }
- vcl_test_write (client_fd, (uint8_t *) & conn->cfg,
- sizeof (conn->cfg), NULL,
- conn->cfg.verbose);
- continue;
- }
-
- switch (rx_cfg->test)
- {
- case SOCK_TEST_TYPE_NONE:
- case SOCK_TEST_TYPE_ECHO:
- sync_config_and_reply (conn, rx_cfg);
- break;
-
- case SOCK_TEST_TYPE_BI:
- case SOCK_TEST_TYPE_UNI:
- stream_test_server_start_stop (conn, rx_cfg);
- break;
-
- case SOCK_TEST_TYPE_EXIT:
- printf ("SERVER: Have a great day, "
- "connection %d!\n", client_fd);
- vppcom_session_close (client_fd);
- conn_pool_free (conn);
- printf ("SERVER: Closed client fd %d\n", client_fd);
- ssm->nfds--;
- if (!ssm->nfds)
- {
- printf ("SERVER: All client connections "
- "closed.\n\nSERVER: "
- "May the force be with you!\n\n");
- goto done;
- }
- break;
-
- default:
- fprintf (stderr,
- "SERVER: ERROR: Unknown test type!\n");
- sock_test_cfg_dump (rx_cfg, 0 /* is_client */ );
- break;
- }
- continue;