Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
关闭连接是指另一端优雅地关闭它。我希望从write()as 返回值中收到 0,但如果我错了,请纠正我。
write()
确切的行为可能取决于底层操作系统,但通常你应该得到一个错误,即,write将返回-1并设置errno(ECONNRESET例如)。
write
-1
errno
ECONNRESET