Select function helps you to know about the file descriptors which are ready for reading , writing. Basically when there is no data present in the socket during recv call it gets blocked till the data arrives so that meanwhile application can to further useful work.
int select() is also useful when there are multiple sockets and an application has to recieve data from them , select solves this problem while polling all the sockets to see if they are available for reading,writing & non-blocking operations.