Why does couchbase sometimes close the alive session?

my application is working ,but sometimes print a exception that"
/[KeyValueEndpoint]: Connection reset by peer:
[KeyValueEndpoint]: Socket connect took longer than specified timeout

i go to watch couchbase’s log
"WARNING 78 Closing connection [ -] due to read error: Connection reset by peer"

this exception will block my application,how can i resolve it?

Couchbase typically doesn’t close the alive session. The only scenario I know of where it would is if you’re opening a huge number of connections. The “due to read error” indicates something unusual is happening. Which version of Couchbase Server and version of the SDK are in use here? Also, what can you tell us about the network topology. Is there any layer 7 switching?

Wireshark can decode Couchbase, so if you see the issue regularly and can capture what is happening just before the read error, it may help us determine what is going on.

thanks,i‘ll try to use Wireshark
here is the enviroment ,the couchbase is 4.0.0, sdk is 2.1.4 and there does have layer 7 switch,