I am a little confused by your application code. I believe you want a select before the connect and another select after the connect but before the recv. That way if the guy you want to connect to is not available your select before the connect will timeout and you can go off and do something else and try again later. Similarly if the connect succeeds but the recv times out, the second select will catch that and allow you to wait until something comes in from the peer.
Be careful that on recv that you check for recv 0 bytes meaning that the peer disconnected. I have seen people forget to check for that and get into a nasty loop.
int block_option = 1; // 1 = on and 0 = off.
then in the call pass a pointer to block_option and typecast to a char *.
So your code replicated below is correct, just, as I stated above, define as an int, typecast to char * and pass pointer to block_option.
setsockopt(tcp_socket, SOL_SOCKET, SO_NONBLOCK, (char*)&block_option, sizeof(block_option));