Implement RFsim stopServer: close listen socket, free memory
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user