The client that connects to you needs to set their own linger options before they connect to you. Same with your server app (you should set linger before you bind the socket).. I'm not sure if you can set that option after the socket has already been connected or after it accepts a connection.. One other thing (and im not 100% sure) but I dont think you need to call shutdown on a socket when it doesn't linger.. I think you can close the socket right away to free up the socket resoruces..
linger linger;
linger.l_onoff = TRUE;
linger.l_linger = 0;
setsockopt(sock, SOL_SOCKET, SO_LINGER, (char *)&linger, sizeof(struct linger));
if(bind(server,(sockaddr*)&local,sizeof(local))!=0)
{
if(server != INVALID_SOCKET)
closesocket(server);
MessageBox("Error Binding socket", "Socket Error", MB\_OK);
}
else
{
if(listen(server,10) != 0)
{
if(server != INVALID_SOCKET)
closesocket(server);
etc.....
}
Hope this gets you pointed in the right direction.. Rob Whoever said nothing's impossible never tried slamming a revolving door!