I'm using non blocking because I'm sending game data. If select is what I need then I will look into it. Thanks!
*edit*
I have a new problem. The program works great in terms of successfully sending information. However, there is about a 10 second lag when I'm trying to send realtime information. This is being sent over local 127.0.0.1. The server takes a long time to send the data after it has been received. and the client takes a long time to send the data to the server.
One cause may be if you're sending many small messages over TCP, they may not actually be transmitted until the outgoing stream buffer is of a certain size.
setsocketopt - Check out TCP_NODELAY