Specifications

printf("connecting\n");
if (connect(song_Server, (struct sockaddr *)&song_server,
sizeof(song_server)) == SOCKET_ERROR)
{
printf("connect() failed: %d\n", WSAGetLastError());
return 1;
}
printf("connected\n");
/* Create the thread to receive the commands */
Thread = CreateThread(NULL, 0, CommandThread,
(LPVOID)command_Server, 0, &ThreadId);
if (Thread == NULL)
{
printf("CreateThread() failed: %d\n", GetLastError());
}
/* stay in main loop until a key is hit */
while(!kbhit())
{
/* delay for fast file skiping */
if(go){
go = 0;
Sleep(400);
if(go == 0){
play = 1;
}
}
/* if the transmision of data is allowed */
if(play){
/* The gap is to be sent send it here */
if (reopen){
printf("sending GAP\n");
bytes_sent = send(Server, "GAP", 5, 0);
if (bytes_sent == SOCKET_ERROR)
{
printf("send() GAP failed:\n");
break;
}
reopen = 0;
Sleep(50);
/* read the file into a buffer and send it to the ethernut */
} else {
/* Read the file */
ReadFile (FileHandle, &buffer[0], 1500, &bytes_read, NULL) ;
/* if at the end of the file open the next one in the playlist */
if(bytes_read == 0){
CloseHandle(FileHandle);
song_no++;
open_MP3(song_no);
ReadFile (FileHandle, &buffer[0], 1500, &bytes_read, NULL) ;
87