문제

This doesn't seem to make sense but:

I am on a slow 10 MBPS link. If I initiate sending a large 13 MB file using NIO sockets, and then exit my program, I see that network activity continues for some time.

I would have thought that exiting the process would terminate any sending.

Any ideas?

도움이 되었습니까?

해결책

If there is pending data to be sent when the socket is closed, it will continue to be sent after the socket is closed until either it is all sent or an error occurs. Both writing and closing are asynchronous in TCP.

This is not peculiar to NIO or even Java.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top