Commit bc8556ea authored by Robert Schmidt's avatar Robert Schmidt

Implement RFsim stopServer: close listen socket, free memory

parent 462d1a6a
......@@ -1085,7 +1085,16 @@ static void rfsimulator_end(openair0_device *device) {
}
close(s->epollfd);
hashtable_destroy(&s->fd_to_buf_map);
free(s);
}
static void stopServer(openair0_device *device)
{
rfsimulator_state_t *t = (rfsimulator_state_t *) device->priv;
DevAssert(t != NULL);
close(t->listen_sock);
rfsimulator_end(device);
}
static int rfsimulator_stop(openair0_device *device) {
return 0;
}
......@@ -1136,7 +1145,7 @@ int device_init(openair0_device *device, openair0_config_t *openair0_cfg) {
device->trx_start_func = rfsimulator->role == SIMU_ROLE_SERVER ? startServer : startClient;
device->trx_get_stats_func = rfsimulator_get_stats;
device->trx_reset_stats_func = rfsimulator_reset_stats;
device->trx_end_func = rfsimulator_end;
device->trx_end_func = rfsimulator->role == SIMU_ROLE_SERVER ? stopServer : rfsimulator_end;
device->trx_stop_func = rfsimulator_stop;
device->trx_set_freq_func = rfsimulator_set_freq;
device->trx_set_gains_func = rfsimulator_set_gains;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment