diff options
-rwxr-xr-x | snowcast_control | bin | 35357 -> 21416 bytes | |||
-rwxr-xr-x | snowcast_listener | bin | 34654 -> 19128 bytes | |||
-rwxr-xr-x | snowcast_server | bin | 55852 -> 38776 bytes | |||
-rw-r--r-- | snowcast_server.dSYM/Contents/Resources/DWARF/snowcast_server | bin | 25447 -> 25644 bytes | |||
-rw-r--r-- | snowcast_server_concurrent.c | 39 |
5 files changed, 23 insertions, 16 deletions
diff --git a/snowcast_control b/snowcast_control Binary files differindex 656ec0f..3c874c7 100755 --- a/snowcast_control +++ b/snowcast_control diff --git a/snowcast_listener b/snowcast_listener Binary files differindex 8d29cf9..9f75571 100755 --- a/snowcast_listener +++ b/snowcast_listener diff --git a/snowcast_server b/snowcast_server Binary files differindex 8ff138a..b40fe10 100755 --- a/snowcast_server +++ b/snowcast_server diff --git a/snowcast_server.dSYM/Contents/Resources/DWARF/snowcast_server b/snowcast_server.dSYM/Contents/Resources/DWARF/snowcast_server Binary files differindex b91915d..faf2f15 100644 --- a/snowcast_server.dSYM/Contents/Resources/DWARF/snowcast_server +++ b/snowcast_server.dSYM/Contents/Resources/DWARF/snowcast_server diff --git a/snowcast_server_concurrent.c b/snowcast_server_concurrent.c index 92b2dee..bb3eee9 100644 --- a/snowcast_server_concurrent.c +++ b/snowcast_server_concurrent.c @@ -371,6 +371,27 @@ void *send_udp_packet_routine(void *arg) { return NULL; } +void *send_announce_routine(void *arg) { + // unpack args + int station_num = (int) arg; + // send the announce messages + for (int i = 0; i < max_active_users; i++) + { + // if (user_data[i].streamThread == NULL) { + // break; + // } + if (user_data[i].sockfd == -1) + continue; + // print_user_data(i); + // update the station of each user + if (user_data[i].stationNum == station_num) + { + // printf("sending announce to user %d\n", i); + send_announce_reply(user_data[i].sockfd, i); + } + } +} + void *synchronization_thread(void *arg) { int c = 0; while (1) @@ -404,22 +425,8 @@ void *synchronization_thread(void *arg) { station_data[i].seekIndex = 0; // printf("resetting station %d\n", i); - // send the announce messages - for (int j = 0; j < max_active_users; i++) - { - // if (user_data[i].streamThread == NULL) { - // break; - // } - if (user_data[j].sockfd == -1) - continue; - // print_user_data(i); - // update the station of each user - if (user_data[j].stationNum == i) - { - // printf("sending announce to user %d\n", i); - send_announce_reply(user_data[j].sockfd, i); - } - } + pthread_t send_announce_thread; + pthread_create(&send_announce_thread, NULL, send_announce_routine, (void *)i); } } |