The question seems like it is entirely answered in this thread.
What is that that is not working for you?
Can you post code for setting the linger option and closing the socket?
Can you describe what you expect to happen in the code?
Can you describe what you observe actually happening, and why you think that's not what should happen?
We can't read your mind, and thus can't answer your question without information.