port reuse problem :TCP socket
socket programming im using infinte loop to send and receive between client and server.so if i want to quit from server i have to use ctrl+c or(ctrl+z) to come out. Then next time i try to run the program , im getting the error "Could not bind listener socket to port". Im closing my socket at the end of progrm. (if i press ctrl+c,my socket should close so that i can reuse the same port for anytime i want). how to make the port reusable?