How to close tcp connection shared by multiple processes?

view story

http://stackoverflow.com – There are 1 user space process A, 1 kernel space process B process A open a tcp connection to some dst, and give the connection to process B. process B uses this connection to communicate with the dst How to terminate the tcp connection via process A? I have tried close(fd) in process A, this doesn't work, because process B still have a copy of this connection. I have tried shutdown(fd, SHUT_RDWR) in process A, this doesn't work, because shutdown leaves the connection still valid. Also kill process A can't terminate the tcp connection, i can still find this connection in netstat. (HowTos)