Specifications
Appendix B – Server Source code
/*
* MP3 player with network interface.
* Server software
* Engineering Thesis 2002
* by Michael Somersmith
*/
#include <winsock2.h>
#include <windows.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <conio.h>
#define DEFAULT_PORT 12345
#define C_PORT 12222
#define S_PORT 11111
#define DEFAULT_BUFFER 2048
int iPort = DEFAULT_PORT; // Port on server to connect to
int cPort = C_PORT; // Port on server to connect to
int sPort = S_PORT; // Port on server to connect to
char play = 0;
char stop = 1;
int song_no = 1;
HANDLE FileHandle;
char reopen = 0;
char repeat = 1;
SOCKET song_Server;
char go = 0;
/*
* Adds the number passed to it to the string
*/
char add_number_song_name(unsigned int number, char * string ){
char length;
char space;
char tmp;
unsigned int power;
unsigned int data;
/* convert the number to base 10 */
data = number;
length = 1;
if(number > 9){
length = 2;
}
if(number > 99){
length = 3;
}
if(number > 999){
length = 4;
}
space = length + 1;
80










