Question: I want to get a flicker button , and then I code like this
I init the button like this:

```
_btn = [[UIButton alloc] initWithFrame:CGRectMake(50, 50, 200, 200)];
[_btn addTarget:self action:@selector(test:) forControlEvents:UIControlEventTouchUpInside];
[_btn setBackgroundImage:[UIImage imageNamed:@"img2.jpg"] forState:UIControlStateNormal];

```

and the I code the animation like this :

```
[UIView animateWithDuration:1 delay:0 options:UIViewAnimationOptionRepeat|UIViewAnimationOptionAutoreverse animations:^{
    _btn.alpha = 0.2;
} completion:nil];

```

The button is vague but it can not be selected , it can not receive the sender .
Anyone knows why it can not receive the sender ?

Answer: 
> 
> Setting time out for connect() function tcp socket programming in C is not working
> 
> 
> 

Correction. Setting the connect timeout *is* working. What 'isn't working' is the subsequent `recvfrom()`, and that's because you left the socket in non-blocking mode and you don't know what to do with the resulting `EAGAIN.` So, either handle that, by using `select()` to tell you when the socket is ready to read, or else put the socket back into blocking mode after finishing the connect.
You receive `EAGAIN` because there's no data to read from socket buffer and your socket was set as `nonblocking`. Since you're not connected with the peer, i'm not surprised with it.

Look at this from `man recvfrom`:

> 
> If no messages are available at the socket, the receive calls wait for a message to arrive, unless the socket is nonblocking (see fcntl(2)), in which case the value -1 is returned and the external variable errno set to EAGAIN. The receive calls normally return any data available, up to the requested amount, rather than waiting for receipt of the full amount requested.
> 
> 
> 

Another case could be the following: 

* *Your socket may be connected but you're too fast checking if something is received.* To avoid this, put another select before recvfrom in order to extract the packet from the socket buffer (calling `readfrom` or just `read`) only when your're sure you received something.