- 论坛徽章:
- 9
|
Godbach 发表于 2016-05-25 15:01 ![]()
回复 3# mordorwww
多线程共享的是 fd,只是大家都通过同一个 fd 进行一些操作。底层的 socket 资源应该 ...
process, are removed (regardless of the file descriptor that was used to obtain the lock).
If fd is the last file descriptor referring to the underlying open file description (see open(2)), the resources associated with the open file description are freed; if the descriptor
was the last reference to a file which has been removed using unlink(2) the file is deleted.
那么socket怎么关闭呢,怎么关闭tcp连接呢,我看了一些资料,使用close关闭应该不太好弄,那样的话,每个线程都要close 一次, 可能要用shutdown |
|