TheOldWiseKing wrote: > I think u should take the line: > > tcp_socket = socket(AF_INET, SOCK_STREAM, 0); > > out of the while loop. Since it performs allocation for the socket. doing > this inside the loop allocates many socket. It's better to allocate single > socket, and connect to the server using the allocated socket. > > Regards,... > > TheOldWiseKing
Wrong. http://linux.die.net/man/3/connect Says: Application Usage If connect() fails, the state of the socket is unspecified. Conforming applications should close the file descriptor and create a new socket before attempting to reconnect. OP seems to be doing it right. -- Thomas Hruska CubicleSoft President Ph: 517-803-4197 *NEW* MyTaskFocus 1.1 Get on task. Stay on task. http://www.CubicleSoft.com/MyTaskFocus/
