[Udpcast] Socket problem in receiver

Alain Knaff alain at knaff.lu
Thu Jun 30 00:19:23 CEST 2011


Hello Sergio,

On 2010-09-30 14:14, Sergio Sánchez Vega wrote:
> Hello,
> 
> I´m using latest udpcast versión (20100130) in Debian machines to transfer
> files in unidirectional mode. Sometimes I see the next message in receiver
> machine: “Receiver error”
> 
> After putting some fprintf I realized the problem is in the file
> udpr-negotiate.c in line 191:
> 
>  
> 
>    sock = udpc_selectSock(client_config.socks, NR_CLIENT_SOCKS,
> 
>                 net_config->startTimeout);
> 
>    if(sock < 0) {
> 
>       return -1;
> 
>    }
> 
>  
> 
> Why sock is < 0? What should I do?

Sock is less than 0 if one of the 2 conditions if met:
 1. "select" system call encounters an error.
 2. select system call returns activity on no socket (i.e. timeout expired)

The select is used to tell which filedescriptor among several is ready
for I/O (this allows udpcast to watch for several events at once,
without knowing in advance which one would occur first).

1. Under normal circumstances, select should not fail, so I think we can
rule this out.
2. If the startTimeout expires without any socket showing activity, sock
is -1 as well. This would be the most common case where this happens.


> 
>  
> 
> Thanks
> 
> 

Regards,

Alain



More information about the Udpcast mailing list