diff options
-rw-r--r-- | Makefile | 2 | ||||
-rw-r--r-- | server.c | 46 | ||||
-rwxr-xr-x | snowcast_control | bin | 0 -> 34893 bytes | |||
-rwxr-xr-x | snowcast_server | bin | 0 -> 54188 bytes |
4 files changed, 1 insertions, 47 deletions
@@ -1,5 +1,5 @@ CC = gcc -CFLAGS = -g -I. -std=gnu99 -Wall -pthread +CFLAGS = -o all: server client @@ -848,52 +848,6 @@ void send_invalid_command_reply(int fd, size_t message_size, char* message) { free(send_buffer); } -// void init_station(int station_num, const char* station_name) { -// station_t *station = &station_data[station_num]; - -// // open the file -// int stream_fd = open(station_name, O_RDONLY); -// if (stream_fd == -1) { -// perror("open"); -// return; -// } -// station->streamFd = stream_fd; -// station->filePath = station_name; - -// // setup file buffer -// char stream_buffer[MAX_STREAM_RATE]; -// memset(stream_buffer, 0, MAX_STREAM_RATE); - -// station->fileBufferSize = MAX_STREAM_RATE; -// memcpy(&station->fileBufferSize, stream_buffer, MAX_STREAM_RATE); - - -// // load the first buffer into the stations -// seek_stations(station_num); -// } - -// void seek_stations(int station_num) { -// station_t *station_info = &station_data[station_num]; -// memset(&station_info->fileBuffer, 0, MAX_STREAM_RATE); -// int bytes_read = read(station_info->streamFd, &station_info->fileBuffer, MAX_STREAM_RATE); -// lseek(station_info->streamFd, -16, SEEK_SET); -// // printf("station info - bytes read: %d, station_fd: %d, filePath: %s, buffersize: %d\n", bytes_read, station_info->streamFd, station_info->filePath, station_info->fileBufferSize); - -// // time to restart the file -// if (bytes_read == 0) { -// if (lseek(station_info->streamFd, 0, SEEK_SET) == -1) { -// perror("fseek"); -// } -// pthread_t send_announce_thread; -// pthread_create(&send_announce_thread, NULL, send_announce_routine, (void *)station_num); - -// // load first chunk -// bytes_read = read(station_info->streamFd, &station_info->fileBuffer, MAX_STREAM_RATE); -// } -// station_info->fileBufferSize = bytes_read; -// } - - // Parses a buffer into tokens, from cs33 :) int parse(char buffer[LINE_MAX], char *tokens[LINE_MAX / 2]) { const char *regex = " \n\t\f\r"; diff --git a/snowcast_control b/snowcast_control Binary files differnew file mode 100755 index 0000000..3496363 --- /dev/null +++ b/snowcast_control diff --git a/snowcast_server b/snowcast_server Binary files differnew file mode 100755 index 0000000..07eb48c --- /dev/null +++ b/snowcast_server |