| View previous topic :: View next topic |
| Author |
Message |
Anonymous Guest
|
Posted: Wed Sep 05, 2007 2:16 pm Post subject: Libshout : socket error. Why? |
|
|
Hi everybody,
I'm working on a multi-threaded icecast client which use libshout (the last version 2.2.2).
And I have a problem with the shout_send function which give me some time to time an Socket error and I don't know why...
Below is the interesting part:
| Code: |
while (1) {
read = fread(buff, 1, sizeof(buff), resource); //resource pointe to a valid mp3 file
if (read > 0) {
ret = shout_send(shout, buff, read); //Here is my BUG: Why this function return a Socket Error ?
if (ret != SHOUTERR_SUCCESS) {
fprintf(stderr, "DEBUG: Send error: %s\n", shout_get_error(shout));
fflush(stderr);
break;
}
}
if (shout_queuelen(shout) > 0) {
fprintf(stderr, "DEBUG: queue length: %d\n", (int)shout_queuelen(shout));
fflush(stderr);
}
shout_sync(shout);
} |
This code is a part of a pthread routine which is called a lot of time by the main program to launch a big number of radios.
So my question is : Why shout_send return an error (socket error in my case) whereas my network between this program and the icecast server is good??
Thanks a lot for your futur answers  |
|
| Back to top |
|
 |
Anonymous Guest
|
Posted: Wed Sep 05, 2007 2:36 pm Post subject: |
|
|
I just get an additional information:
When a add this code for testing what is the error that shout_send returns, I have the result SOCKET. So the documentation says me An error occured while talking to the server. But what error??
| Code: |
ret = shout_send(shout, buff, read);
if (ret != SHOUTERR_SUCCESS) {
switch(ret) {
case SHOUTERR_INSANE:
fprintf(stderr,"INSANE");
break;
case SHOUTERR_UNCONNECTED:
fprintf(stderr,"UNCONNECTED");
break;
case SHOUTERR_MALLOC:
fprintf(stderr,"MALLOC");
break;
case SHOUTERR_SOCKET:
fprintf(stderr,"SOCKET");
break;
}
fflush(stderr);
fprintf(stderr, "DEBUG: Send error: %s\n", shout_get_error(shout)); |
|
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2002 phpBB Group subRebel style by ktauber
|