Specifications

/* Set up the network information structures */
server.sin_family = AF_INET;
server.sin_port = htons(iPort);
server.sin_addr.s_addr = inet_addr("192.168.0.100");
command_server.sin_family = AF_INET;
command_server.sin_port = htons(cPort);
command_server.sin_addr.s_addr = inet_addr("192.168.0.100");
song_server.sin_family = AF_INET;
song_server.sin_port = htons(sPort);
song_server.sin_addr.s_addr = inet_addr("192.168.0.100");
/* Create the socket for the MP3 stream */
Server = socket(AF_INET, SOCK_STREAM, 0);
if (Server == INVALID_SOCKET)
{
printf("socket() failed: %d\n", WSAGetLastError());
return 1;
}
/* connect this socket to the ethernut */
printf("connecting\n");
if (connect(Server, (struct sockaddr *)&server,
sizeof(server)) == SOCKET_ERROR)
{
printf("connect() failed: %d\n", WSAGetLastError());
return 1;
}
printf("connected\n");
/* Create the socket for the command passing */
command_Server = socket(AF_INET, SOCK_STREAM, 0);
if (command_Server == INVALID_SOCKET)
{
printf("socket() failed: %d\n", WSAGetLastError());
return 1;
}
/* connect this socket to the ethernut */
printf("connecting\n");
if (connect(command_Server, (struct sockaddr *)&command_server,
sizeof(command_server)) == SOCKET_ERROR)
{
printf("connect() failed: %d\n", WSAGetLastError());
return 1;
}
printf("connected\n");
/* Create the socket for the song name */
song_Server = socket(AF_INET, SOCK_STREAM, 0);
if (song_Server == INVALID_SOCKET)
{
printf("socket() failed: %d\n", WSAGetLastError());
return 1;
}
/* connect this socket to the ethernut */
86