i=1; i=setsockopt(s,SOL_SOCKET,SO_REUSEADDR,(char *)&i,sizeof(i)); if (i < 0) { perror("option:reuseaddr"); return(0); }