i write an program which use sockets .
i create a socket ( mySocket=socket(PF_INET,SOCK_STREAM,IPPROTO_TCP) ).
i connect it to remote server ( HTTP ).
i try to send some data to remote server . it works fine when my connection to Net is not very busy otherwise the "send(...)" function return 0 - that means no data was sent ( to be sure i can send data i use "select(...)" function before i use "send(...)" ) .
now , what should i do in this case ?
what i actually do : close the socket , create another socket etc. but this means a waste of time . should i try to send data using the same socket ?
since it is an HTTP server it may close the connection before i can send my data and it is important for me to know that this particular data reach to server .

any idea will be appreciated .
thanks in advance .